This commit is contained in:
sxu 2025-05-25 20:00:31 +08:00
parent 947233f79a
commit 183989d1ac
6 changed files with 0 additions and 469 deletions

View File

@ -1,119 +0,0 @@
package com.bonus.canteen.core.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
//import com.bonus.canteen.core.device.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.canteen.core.device.domain.CookRecipeBindDevice;
import com.bonus.canteen.core.device.service.ICookRecipeBindDeviceService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.page.TableDataInfo;
/**
* 设备绑定多档口子Controller
*
* @author xsheng
* @date 2025-05-25
*/
@Api(tags = "设备绑定多档口子接口")
@RestController
@RequestMapping("/cook_recipe_bind_device")
public class CookRecipeBindDeviceController extends BaseController {
@Autowired
private ICookRecipeBindDeviceService cookRecipeBindDeviceService;
/**
* 查询设备绑定多档口子列表
*/
@ApiOperation(value = "查询设备绑定多档口子列表")
//@RequiresPermissions("device:device:list")
@GetMapping("/list")
public TableDataInfo list(CookRecipeBindDevice cookRecipeBindDevice) {
startPage();
List<CookRecipeBindDevice> list = cookRecipeBindDeviceService.selectCookRecipeBindDeviceList(cookRecipeBindDevice);
return getDataTable(list);
}
/**
* 导出设备绑定多档口子列表
*/
@ApiOperation(value = "导出设备绑定多档口子列表")
//@PreventRepeatSubmit
//@RequiresPermissions("device:device:export")
@SysLog(title = "设备绑定多档口子", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出设备绑定多档口子")
@PostMapping("/export")
public void export(HttpServletResponse response, CookRecipeBindDevice cookRecipeBindDevice) {
List<CookRecipeBindDevice> list = cookRecipeBindDeviceService.selectCookRecipeBindDeviceList(cookRecipeBindDevice);
ExcelUtil<CookRecipeBindDevice> util = new ExcelUtil<CookRecipeBindDevice>(CookRecipeBindDevice.class);
util.exportExcel(response, list, "设备绑定多档口子数据");
}
/**
* 获取设备绑定多档口子详细信息
*/
@ApiOperation(value = "获取设备绑定多档口子详细信息")
//@RequiresPermissions("device:device:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(cookRecipeBindDeviceService.selectCookRecipeBindDeviceById(id));
}
/**
* 新增设备绑定多档口子
*/
@ApiOperation(value = "新增设备绑定多档口子")
//@PreventRepeatSubmit
//@RequiresPermissions("device:device:add")
@SysLog(title = "设备绑定多档口子", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增设备绑定多档口子")
@PostMapping
public AjaxResult add(@RequestBody CookRecipeBindDevice cookRecipeBindDevice) {
try {
return toAjax(cookRecipeBindDeviceService.insertCookRecipeBindDevice(cookRecipeBindDevice));
} catch (Exception e) {
return error(e.getMessage());
}
}
/**
* 修改设备绑定多档口子
*/
@ApiOperation(value = "修改设备绑定多档口子")
//@PreventRepeatSubmit
//@RequiresPermissions("device:device:edit")
@SysLog(title = "设备绑定多档口子", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改设备绑定多档口子")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody CookRecipeBindDevice cookRecipeBindDevice) {
try {
return toAjax(cookRecipeBindDeviceService.updateCookRecipeBindDevice(cookRecipeBindDevice));
} catch (Exception e) {
return error(e.getMessage());
}
}
/**
* 删除设备绑定多档口子
*/
@ApiOperation(value = "删除设备绑定多档口子")
//@PreventRepeatSubmit
//@RequiresPermissions("device:device:remove")
@SysLog(title = "设备绑定多档口子", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除设备绑定多档口子")
@PostMapping("/del/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(cookRecipeBindDeviceService.deleteCookRecipeBindDeviceByIds(ids));
}
}

View File

@ -1,46 +0,0 @@
package com.bonus.canteen.core.device.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 设备绑定多档口子对象 cook_recipe_bind_device
*
* @author xsheng
* @date 2025-05-25
*/
@Data
@ToString
public class CookRecipeBindDevice extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键id */
private Long id;
/** 设备id */
@Excel(name = "设备id ")
@ApiModelProperty(value = "设备id ")
private Long deviceId;
/** 食堂ID */
@Excel(name = "食堂ID")
@ApiModelProperty(value = "食堂ID")
private Long canteenId;
/** 店铺档口id */
@Excel(name = "店铺档口id")
@ApiModelProperty(value = "店铺档口id")
private Long stallId;
/** 菜谱id */
@Excel(name = "菜谱id")
@ApiModelProperty(value = "菜谱id")
private Long recipeId;
}

View File

@ -1,60 +0,0 @@
package com.bonus.canteen.core.device.mapper;
import java.util.List;
import com.bonus.canteen.core.device.domain.CookRecipeBindDevice;
/**
* 设备绑定多档口子Mapper接口
*
* @author xsheng
* @date 2025-05-25
*/
public interface CookRecipeBindDeviceMapper {
/**
* 查询设备绑定多档口子
*
* @param id 设备绑定多档口子主键
* @return 设备绑定多档口子
*/
public CookRecipeBindDevice selectCookRecipeBindDeviceById(Long id);
/**
* 查询设备绑定多档口子列表
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 设备绑定多档口子集合
*/
public List<CookRecipeBindDevice> selectCookRecipeBindDeviceList(CookRecipeBindDevice cookRecipeBindDevice);
/**
* 新增设备绑定多档口子
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 结果
*/
public int insertCookRecipeBindDevice(CookRecipeBindDevice cookRecipeBindDevice);
/**
* 修改设备绑定多档口子
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 结果
*/
public int updateCookRecipeBindDevice(CookRecipeBindDevice cookRecipeBindDevice);
/**
* 删除设备绑定多档口子
*
* @param id 设备绑定多档口子主键
* @return 结果
*/
public int deleteCookRecipeBindDeviceById(Long id);
/**
* 批量删除设备绑定多档口子
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCookRecipeBindDeviceByIds(Long[] ids);
}

View File

@ -1,60 +0,0 @@
package com.bonus.canteen.core.device.service;
import java.util.List;
import com.bonus.canteen.core.device.domain.CookRecipeBindDevice;
/**
* 设备绑定多档口子Service接口
*
* @author xsheng
* @date 2025-05-25
*/
public interface ICookRecipeBindDeviceService {
/**
* 查询设备绑定多档口子
*
* @param id 设备绑定多档口子主键
* @return 设备绑定多档口子
*/
public CookRecipeBindDevice selectCookRecipeBindDeviceById(Long id);
/**
* 查询设备绑定多档口子列表
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 设备绑定多档口子集合
*/
public List<CookRecipeBindDevice> selectCookRecipeBindDeviceList(CookRecipeBindDevice cookRecipeBindDevice);
/**
* 新增设备绑定多档口子
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 结果
*/
public int insertCookRecipeBindDevice(CookRecipeBindDevice cookRecipeBindDevice);
/**
* 修改设备绑定多档口子
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 结果
*/
public int updateCookRecipeBindDevice(CookRecipeBindDevice cookRecipeBindDevice);
/**
* 批量删除设备绑定多档口子
*
* @param ids 需要删除的设备绑定多档口子主键集合
* @return 结果
*/
public int deleteCookRecipeBindDeviceByIds(Long[] ids);
/**
* 删除设备绑定多档口子信息
*
* @param id 设备绑定多档口子主键
* @return 结果
*/
public int deleteCookRecipeBindDeviceById(Long id);
}

View File

@ -1,98 +0,0 @@
package com.bonus.canteen.core.device.service.impl;
import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.canteen.core.device.mapper.CookRecipeBindDeviceMapper;
import com.bonus.canteen.core.device.domain.CookRecipeBindDevice;
import com.bonus.canteen.core.device.service.ICookRecipeBindDeviceService;
/**
* 设备绑定多档口子Service业务层处理
*
* @author xsheng
* @date 2025-05-25
*/
@Service
public class CookRecipeBindDeviceServiceImpl implements ICookRecipeBindDeviceService {
@Autowired
private CookRecipeBindDeviceMapper cookRecipeBindDeviceMapper;
/**
* 查询设备绑定多档口子
*
* @param id 设备绑定多档口子主键
* @return 设备绑定多档口子
*/
@Override
public CookRecipeBindDevice selectCookRecipeBindDeviceById(Long id) {
return cookRecipeBindDeviceMapper.selectCookRecipeBindDeviceById(id);
}
/**
* 查询设备绑定多档口子列表
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 设备绑定多档口子
*/
@Override
public List<CookRecipeBindDevice> selectCookRecipeBindDeviceList(CookRecipeBindDevice cookRecipeBindDevice) {
return cookRecipeBindDeviceMapper.selectCookRecipeBindDeviceList(cookRecipeBindDevice);
}
/**
* 新增设备绑定多档口子
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 结果
*/
@Override
public int insertCookRecipeBindDevice(CookRecipeBindDevice cookRecipeBindDevice) {
cookRecipeBindDevice.setCreateTime(DateUtils.getNowDate());
try {
return cookRecipeBindDeviceMapper.insertCookRecipeBindDevice(cookRecipeBindDevice);
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
}
/**
* 修改设备绑定多档口子
*
* @param cookRecipeBindDevice 设备绑定多档口子
* @return 结果
*/
@Override
public int updateCookRecipeBindDevice(CookRecipeBindDevice cookRecipeBindDevice) {
cookRecipeBindDevice.setUpdateTime(DateUtils.getNowDate());
try {
return cookRecipeBindDeviceMapper.updateCookRecipeBindDevice(cookRecipeBindDevice);
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
}
/**
* 批量删除设备绑定多档口子
*
* @param ids 需要删除的设备绑定多档口子主键
* @return 结果
*/
@Override
public int deleteCookRecipeBindDeviceByIds(Long[] ids) {
return cookRecipeBindDeviceMapper.deleteCookRecipeBindDeviceByIds(ids);
}
/**
* 删除设备绑定多档口子信息
*
* @param id 设备绑定多档口子主键
* @return 结果
*/
@Override
public int deleteCookRecipeBindDeviceById(Long id) {
return cookRecipeBindDeviceMapper.deleteCookRecipeBindDeviceById(id);
}
}

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.device.mapper.CookRecipeBindDeviceMapper">
<resultMap type="com.bonus.canteen.core.device.domain.CookRecipeBindDevice" id="CookRecipeBindDeviceResult">
<result property="id" column="id" />
<result property="deviceId" column="device_id" />
<result property="canteenId" column="canteen_id" />
<result property="stallId" column="stall_id" />
<result property="recipeId" column="recipe_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectCookRecipeBindDeviceVo">
select id, device_id, canteen_id, stall_id, recipe_id, create_by, create_time, update_by, update_time from cook_recipe_bind_device
</sql>
<select id="selectCookRecipeBindDeviceList" parameterType="com.bonus.canteen.core.device.domain.CookRecipeBindDevice" resultMap="CookRecipeBindDeviceResult">
<include refid="selectCookRecipeBindDeviceVo"/>
<where>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
<if test="stallId != null "> and stall_id = #{stallId}</if>
<if test="recipeId != null "> and recipe_id = #{recipeId}</if>
</where>
</select>
<select id="selectCookRecipeBindDeviceById" parameterType="Long" resultMap="CookRecipeBindDeviceResult">
<include refid="selectCookRecipeBindDeviceVo"/>
where id = #{id}
</select>
<insert id="insertCookRecipeBindDevice" parameterType="com.bonus.canteen.core.device.domain.CookRecipeBindDevice" useGeneratedKeys="true" keyProperty="id">
insert into cook_recipe_bind_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="canteenId != null">canteen_id,</if>
<if test="stallId != null">stall_id,</if>
<if test="recipeId != null">recipe_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="canteenId != null">#{canteenId},</if>
<if test="stallId != null">#{stallId},</if>
<if test="recipeId != null">#{recipeId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateCookRecipeBindDevice" parameterType="com.bonus.canteen.core.device.domain.CookRecipeBindDevice">
update cook_recipe_bind_device
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="canteenId != null">canteen_id = #{canteenId},</if>
<if test="stallId != null">stall_id = #{stallId},</if>
<if test="recipeId != null">recipe_id = #{recipeId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCookRecipeBindDeviceById" parameterType="Long">
delete from cook_recipe_bind_device where id = #{id}
</delete>
<delete id="deleteCookRecipeBindDeviceByIds" parameterType="String">
delete from cook_recipe_bind_device where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>