From 85766fc81daffcabfd7c2b2d6cdf969852bb9071 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 15 Jul 2025 08:57:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E9=93=BE=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ims/controller/ImsSettingController.java | 119 ++++++++++++++++++ .../canteen/core/ims/domain/ImsSetting.java | 46 +++++++ .../core/ims/mapper/ImsSettingMapper.java | 60 +++++++++ .../core/ims/service/IImsSettingService.java | 60 +++++++++ .../service/impl/ImsSettingServiceImpl.java | 98 +++++++++++++++ .../resources/mapper/ims/ImsSettingMapper.xml | 86 +++++++++++++ 6 files changed, 469 insertions(+) create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsSettingController.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsSetting.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsSettingMapper.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IImsSettingService.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsSettingServiceImpl.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsSettingMapper.xml diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsSettingController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsSettingController.java new file mode 100644 index 0000000..90e70f0 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsSettingController.java @@ -0,0 +1,119 @@ +package com.bonus.canteen.core.ims.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import com.bonus.common.log.enums.OperaType; +//import com.bonus.canteen.core.ims.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.ims.domain.ImsSetting; +import com.bonus.canteen.core.ims.service.IImsSettingService; +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-07-15 + */ +@Api(tags = "厨房功能参数配置接口") +@RestController +@RequestMapping("/ims_setting") +public class ImsSettingController extends BaseController { + @Autowired + private IImsSettingService imsSettingService; + + /** + * 查询厨房功能参数配置列表 + */ + @ApiOperation(value = "查询厨房功能参数配置列表") + //@RequiresPermissions("ims:setting:list") + @GetMapping("/list") + public TableDataInfo list(ImsSetting imsSetting) { + startPage(); + List list = imsSettingService.selectImsSettingList(imsSetting); + return getDataTable(list); + } + + /** + * 导出厨房功能参数配置列表 + */ + @ApiOperation(value = "导出厨房功能参数配置列表") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:setting:export") + @SysLog(title = "厨房功能参数配置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出厨房功能参数配置") + @PostMapping("/export") + public void export(HttpServletResponse response, ImsSetting imsSetting) { + List list = imsSettingService.selectImsSettingList(imsSetting); + ExcelUtil util = new ExcelUtil(ImsSetting.class); + util.exportExcel(response, list, "厨房功能参数配置数据"); + } + + /** + * 获取厨房功能参数配置详细信息 + */ + @ApiOperation(value = "获取厨房功能参数配置详细信息") + //@RequiresPermissions("ims:setting:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(imsSettingService.selectImsSettingById(id)); + } + + /** + * 新增厨房功能参数配置 + */ + @ApiOperation(value = "新增厨房功能参数配置") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:setting:add") + @SysLog(title = "厨房功能参数配置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增厨房功能参数配置") + @PostMapping + public AjaxResult add(@RequestBody ImsSetting imsSetting) { + try { + return toAjax(imsSettingService.insertImsSetting(imsSetting)); + } catch (Exception e) { + return error(e.getMessage()); + } + } + + /** + * 修改厨房功能参数配置 + */ + @ApiOperation(value = "修改厨房功能参数配置") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:setting:edit") + @SysLog(title = "厨房功能参数配置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改厨房功能参数配置") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody ImsSetting imsSetting) { + try { + return toAjax(imsSettingService.updateImsSetting(imsSetting)); + } catch (Exception e) { + return error(e.getMessage()); + } + } + + /** + * 删除厨房功能参数配置 + */ + @ApiOperation(value = "删除厨房功能参数配置") + //@PreventRepeatSubmit + //@RequiresPermissions("ims:setting:remove") + @SysLog(title = "厨房功能参数配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除厨房功能参数配置") + @PostMapping("/del/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(imsSettingService.deleteImsSettingByIds(ids)); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsSetting.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsSetting.java new file mode 100644 index 0000000..7b26231 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsSetting.java @@ -0,0 +1,46 @@ +package com.bonus.canteen.core.ims.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; + +/** + * 厨房功能参数配置对象 ims_setting + * + * @author xsheng + * @date 2025-07-15 + */ + + +@Data +@ToString +public class ImsSetting extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** 参数名 */ + @Excel(name = "参数名") + @ApiModelProperty(value = "参数名") + private String itemName; + + /** 参数值 */ + @Excel(name = "参数值") + @ApiModelProperty(value = "参数值") + private String itemValue; + + /** 参数名说明 */ + @Excel(name = "参数名说明") + @ApiModelProperty(value = "参数名说明") + private String itemDescription; + + /** 用途类型(1-后台;2-APP) */ + @Excel(name = "用途类型(1-后台;2-APP)") + @ApiModelProperty(value = "用途类型(1-后台;2-APP)") + private String usageType; + + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsSettingMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsSettingMapper.java new file mode 100644 index 0000000..d1c5f9f --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/ImsSettingMapper.java @@ -0,0 +1,60 @@ +package com.bonus.canteen.core.ims.mapper; + +import java.util.List; +import com.bonus.canteen.core.ims.domain.ImsSetting; + +/** + * 厨房功能参数配置Mapper接口 + * + * @author xsheng + * @date 2025-07-15 + */ +public interface ImsSettingMapper { + /** + * 查询厨房功能参数配置 + * + * @param id 厨房功能参数配置主键 + * @return 厨房功能参数配置 + */ + public ImsSetting selectImsSettingById(Long id); + + /** + * 查询厨房功能参数配置列表 + * + * @param imsSetting 厨房功能参数配置 + * @return 厨房功能参数配置集合 + */ + public List selectImsSettingList(ImsSetting imsSetting); + + /** + * 新增厨房功能参数配置 + * + * @param imsSetting 厨房功能参数配置 + * @return 结果 + */ + public int insertImsSetting(ImsSetting imsSetting); + + /** + * 修改厨房功能参数配置 + * + * @param imsSetting 厨房功能参数配置 + * @return 结果 + */ + public int updateImsSetting(ImsSetting imsSetting); + + /** + * 删除厨房功能参数配置 + * + * @param id 厨房功能参数配置主键 + * @return 结果 + */ + public int deleteImsSettingById(Long id); + + /** + * 批量删除厨房功能参数配置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteImsSettingByIds(Long[] ids); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IImsSettingService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IImsSettingService.java new file mode 100644 index 0000000..7230d97 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/IImsSettingService.java @@ -0,0 +1,60 @@ +package com.bonus.canteen.core.ims.service; + +import java.util.List; +import com.bonus.canteen.core.ims.domain.ImsSetting; + +/** + * 厨房功能参数配置Service接口 + * + * @author xsheng + * @date 2025-07-15 + */ +public interface IImsSettingService { + /** + * 查询厨房功能参数配置 + * + * @param id 厨房功能参数配置主键 + * @return 厨房功能参数配置 + */ + public ImsSetting selectImsSettingById(Long id); + + /** + * 查询厨房功能参数配置列表 + * + * @param imsSetting 厨房功能参数配置 + * @return 厨房功能参数配置集合 + */ + public List selectImsSettingList(ImsSetting imsSetting); + + /** + * 新增厨房功能参数配置 + * + * @param imsSetting 厨房功能参数配置 + * @return 结果 + */ + public int insertImsSetting(ImsSetting imsSetting); + + /** + * 修改厨房功能参数配置 + * + * @param imsSetting 厨房功能参数配置 + * @return 结果 + */ + public int updateImsSetting(ImsSetting imsSetting); + + /** + * 批量删除厨房功能参数配置 + * + * @param ids 需要删除的厨房功能参数配置主键集合 + * @return 结果 + */ + public int deleteImsSettingByIds(Long[] ids); + + /** + * 删除厨房功能参数配置信息 + * + * @param id 厨房功能参数配置主键 + * @return 结果 + */ + public int deleteImsSettingById(Long id); +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsSettingServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsSettingServiceImpl.java new file mode 100644 index 0000000..eb7bd74 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsSettingServiceImpl.java @@ -0,0 +1,98 @@ +package com.bonus.canteen.core.ims.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.ims.mapper.ImsSettingMapper; +import com.bonus.canteen.core.ims.domain.ImsSetting; +import com.bonus.canteen.core.ims.service.IImsSettingService; + +/** + * 厨房功能参数配置Service业务层处理 + * + * @author xsheng + * @date 2025-07-15 + */ +@Service +public class ImsSettingServiceImpl implements IImsSettingService { + @Autowired + private ImsSettingMapper imsSettingMapper; + + /** + * 查询厨房功能参数配置 + * + * @param id 厨房功能参数配置主键 + * @return 厨房功能参数配置 + */ + @Override + public ImsSetting selectImsSettingById(Long id) { + return imsSettingMapper.selectImsSettingById(id); + } + + /** + * 查询厨房功能参数配置列表 + * + * @param imsSetting 厨房功能参数配置 + * @return 厨房功能参数配置 + */ + @Override + public List selectImsSettingList(ImsSetting imsSetting) { + return imsSettingMapper.selectImsSettingList(imsSetting); + } + + /** + * 新增厨房功能参数配置 + * + * @param imsSetting 厨房功能参数配置 + * @return 结果 + */ + @Override + public int insertImsSetting(ImsSetting imsSetting) { + imsSetting.setCreateTime(DateUtils.getNowDate()); + try { + return imsSettingMapper.insertImsSetting(imsSetting); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 修改厨房功能参数配置 + * + * @param imsSetting 厨房功能参数配置 + * @return 结果 + */ + @Override + public int updateImsSetting(ImsSetting imsSetting) { + imsSetting.setUpdateTime(DateUtils.getNowDate()); + try { + return imsSettingMapper.updateImsSetting(imsSetting); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 批量删除厨房功能参数配置 + * + * @param ids 需要删除的厨房功能参数配置主键 + * @return 结果 + */ + @Override + public int deleteImsSettingByIds(Long[] ids) { + return imsSettingMapper.deleteImsSettingByIds(ids); + } + + /** + * 删除厨房功能参数配置信息 + * + * @param id 厨房功能参数配置主键 + * @return 结果 + */ + @Override + public int deleteImsSettingById(Long id) { + return imsSettingMapper.deleteImsSettingById(id); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsSettingMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsSettingMapper.xml new file mode 100644 index 0000000..7db596e --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ImsSettingMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + select id, item_name, item_value, item_description, usage_type, create_by, create_time, update_by, update_time from ims_setting + + + + + + + + insert into ims_setting + + item_name, + item_value, + item_description, + usage_type, + create_by, + create_time, + update_by, + update_time, + + + #{itemName}, + #{itemValue}, + #{itemDescription}, + #{usageType}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update ims_setting + + item_name = #{itemName}, + item_value = #{itemValue}, + item_description = #{itemDescription}, + usage_type = #{usageType}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from ims_setting where id = #{id} + + + + delete from ims_setting where id in + + #{id} + + + \ No newline at end of file