仓库点位管理
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bas.warehousePort.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.bas.warehousePort.domain.BasWarehousePort;
|
||||
import com.ruoyi.bas.warehousePort.service.IBasWarehousePortService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/warehousePort")
|
||||
public class BasWarehousePortController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasWarehousePortService basWarehousePortService;
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
startPage();
|
||||
List<BasWarehousePort> list = basWarehousePortService.selectBasWarehousePortList(basWarehousePort);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出仓库出入管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:export')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasWarehousePort basWarehousePort)
|
||||
{
|
||||
List<BasWarehousePort> list = basWarehousePortService.selectBasWarehousePortList(basWarehousePort);
|
||||
ExcelUtil<BasWarehousePort> util = new ExcelUtil<BasWarehousePort>(BasWarehousePort.class);
|
||||
util.exportExcel(response, list, "仓库出入管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取仓库出入管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(basWarehousePortService.selectBasWarehousePortById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:add')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return toAjax(basWarehousePortService.insertBasWarehousePort(basWarehousePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:edit')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return toAjax(basWarehousePortService.updateBasWarehousePort(basWarehousePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:warehousePort:remove')")
|
||||
@Log(title = "仓库出入管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(basWarehousePortService.deleteBasWarehousePortByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.ruoyi.bas.warehousePort.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 仓库出入管理对象 bas_warehouse_port
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public class BasWarehousePort extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 仓库id */
|
||||
@Excel(name = "仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/** 端点编码 */
|
||||
@Excel(name = "端点编码")
|
||||
private String portCode;
|
||||
|
||||
/** 端点名称 */
|
||||
@Excel(name = "端点名称")
|
||||
private String portName;
|
||||
|
||||
/** 端点类型 1-入口 2-出口 */
|
||||
@Excel(name = "端点类型 1-入口 2-出口")
|
||||
private String portType;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setPortCode(String portCode)
|
||||
{
|
||||
this.portCode = portCode;
|
||||
}
|
||||
|
||||
public String getPortCode()
|
||||
{
|
||||
return portCode;
|
||||
}
|
||||
|
||||
public void setPortName(String portName)
|
||||
{
|
||||
this.portName = portName;
|
||||
}
|
||||
|
||||
public String getPortName()
|
||||
{
|
||||
return portName;
|
||||
}
|
||||
|
||||
public void setPortType(String portType)
|
||||
{
|
||||
this.portType = portType;
|
||||
}
|
||||
|
||||
public String getPortType()
|
||||
{
|
||||
return portType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("portCode", getPortCode())
|
||||
.append("portName", getPortName())
|
||||
.append("portType", getPortType())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.warehousePort.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.warehousePort.domain.BasWarehousePort;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public interface BasWarehousePortMapper
|
||||
{
|
||||
/**
|
||||
* 查询仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
public BasWarehousePort selectBasWarehousePortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 仓库出入管理集合
|
||||
*/
|
||||
public List<BasWarehousePort> selectBasWarehousePortList(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除仓库出入管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.warehousePort.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.warehousePort.domain.BasWarehousePort;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
public interface IBasWarehousePortService
|
||||
{
|
||||
/**
|
||||
* 查询仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
public BasWarehousePort selectBasWarehousePortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 仓库出入管理集合
|
||||
*/
|
||||
public List<BasWarehousePort> selectBasWarehousePortList(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasWarehousePort(BasWarehousePort basWarehousePort);
|
||||
|
||||
/**
|
||||
* 批量删除仓库出入管理
|
||||
*
|
||||
* @param ids 需要删除的仓库出入管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理信息
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasWarehousePortById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.bas.warehousePort.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.warehousePort.mapper.BasWarehousePortMapper;
|
||||
import com.ruoyi.bas.warehousePort.domain.BasWarehousePort;
|
||||
import com.ruoyi.bas.warehousePort.service.IBasWarehousePortService;
|
||||
|
||||
/**
|
||||
* 仓库出入管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-12
|
||||
*/
|
||||
@Service
|
||||
public class BasWarehousePortServiceImpl implements IBasWarehousePortService
|
||||
{
|
||||
@Autowired
|
||||
private BasWarehousePortMapper basWarehousePortMapper;
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
@Override
|
||||
public BasWarehousePort selectBasWarehousePortById(Long id)
|
||||
{
|
||||
return basWarehousePortMapper.selectBasWarehousePortById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库出入管理列表
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 仓库出入管理
|
||||
*/
|
||||
@Override
|
||||
public List<BasWarehousePort> selectBasWarehousePortList(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return basWarehousePortMapper.selectBasWarehousePortList(basWarehousePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasWarehousePort(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return basWarehousePortMapper.insertBasWarehousePort(basWarehousePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库出入管理
|
||||
*
|
||||
* @param basWarehousePort 仓库出入管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasWarehousePort(BasWarehousePort basWarehousePort)
|
||||
{
|
||||
return basWarehousePortMapper.updateBasWarehousePort(basWarehousePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库出入管理
|
||||
*
|
||||
* @param ids 需要删除的仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasWarehousePortByIds(Long[] ids)
|
||||
{
|
||||
return basWarehousePortMapper.deleteBasWarehousePortByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库出入管理信息
|
||||
*
|
||||
* @param id 仓库出入管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasWarehousePortById(Long id)
|
||||
{
|
||||
return basWarehousePortMapper.deleteBasWarehousePortById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?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.ruoyi.bas.warehousePort.mapper.BasWarehousePortMapper">
|
||||
|
||||
<resultMap type="BasWarehousePort" id="BasWarehousePortResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="portCode" column="port_code" />
|
||||
<result property="portName" column="port_name" />
|
||||
<result property="portType" column="port_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasWarehousePortVo">
|
||||
select id, warehouse_id, port_code, port_name, port_type from bas_warehouse_port
|
||||
</sql>
|
||||
|
||||
<select id="selectBasWarehousePortList" parameterType="BasWarehousePort" resultMap="BasWarehousePortResult">
|
||||
<include refid="selectBasWarehousePortVo"/>
|
||||
<where>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="portCode != null and portCode != ''"> and port_code = #{portCode}</if>
|
||||
<if test="portName != null and portName != ''"> and port_name like concat('%', #{portName}, '%')</if>
|
||||
<if test="portType != null and portType != ''"> and port_type = #{portType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasWarehousePortById" parameterType="Long" resultMap="BasWarehousePortResult">
|
||||
<include refid="selectBasWarehousePortVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBasWarehousePort" parameterType="BasWarehousePort">
|
||||
insert into bas_warehouse_port
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="portCode != null">port_code,</if>
|
||||
<if test="portName != null">port_name,</if>
|
||||
<if test="portType != null">port_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="portCode != null">#{portCode},</if>
|
||||
<if test="portName != null">#{portName},</if>
|
||||
<if test="portType != null">#{portType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasWarehousePort" parameterType="BasWarehousePort">
|
||||
update bas_warehouse_port
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="portCode != null">port_code = #{portCode},</if>
|
||||
<if test="portName != null">port_name = #{portName},</if>
|
||||
<if test="portType != null">port_type = #{portType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasWarehousePortById" parameterType="Long">
|
||||
delete from bas_warehouse_port where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasWarehousePortByIds" parameterType="String">
|
||||
delete from bas_warehouse_port where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user