供应链设置
This commit is contained in:
parent
693517b9e0
commit
85766fc81d
|
|
@ -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<ImsSetting> 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<ImsSetting> list = imsSettingService.selectImsSettingList(imsSetting);
|
||||
ExcelUtil<ImsSetting> util = new ExcelUtil<ImsSetting>(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));
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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<ImsSetting> 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);
|
||||
}
|
||||
|
|
@ -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<ImsSetting> 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);
|
||||
}
|
||||
|
|
@ -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<ImsSetting> 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<?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.ims.mapper.ImsSettingMapper">
|
||||
<resultMap type="com.bonus.canteen.core.ims.domain.ImsSetting" id="ImsSettingResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="itemValue" column="item_value" />
|
||||
<result property="itemDescription" column="item_description" />
|
||||
<result property="usageType" column="usage_type" />
|
||||
<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="selectImsSettingVo">
|
||||
select id, item_name, item_value, item_description, usage_type, create_by, create_time, update_by, update_time from ims_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectImsSettingList" parameterType="com.bonus.canteen.core.ims.domain.ImsSetting" resultMap="ImsSettingResult">
|
||||
<include refid="selectImsSettingVo"/>
|
||||
<where>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="itemValue != null and itemValue != ''"> and item_value = #{itemValue}</if>
|
||||
<if test="itemDescription != null and itemDescription != ''"> and item_description = #{itemDescription}</if>
|
||||
<if test="usageType != null and usageType != ''"> and usage_type = #{usageType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectImsSettingById" parameterType="Long" resultMap="ImsSettingResult">
|
||||
<include refid="selectImsSettingVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertImsSetting" parameterType="com.bonus.canteen.core.ims.domain.ImsSetting" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ims_setting
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="itemValue != null">item_value,</if>
|
||||
<if test="itemDescription != null">item_description,</if>
|
||||
<if test="usageType != null">usage_type,</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="itemName != null">#{itemName},</if>
|
||||
<if test="itemValue != null">#{itemValue},</if>
|
||||
<if test="itemDescription != null">#{itemDescription},</if>
|
||||
<if test="usageType != null">#{usageType},</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="updateImsSetting" parameterType="com.bonus.canteen.core.ims.domain.ImsSetting">
|
||||
update ims_setting
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="itemValue != null">item_value = #{itemValue},</if>
|
||||
<if test="itemDescription != null">item_description = #{itemDescription},</if>
|
||||
<if test="usageType != null">usage_type = #{usageType},</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="deleteImsSettingById" parameterType="Long">
|
||||
delete from ims_setting where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteImsSettingByIds" parameterType="String">
|
||||
delete from ims_setting where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue