新增仓库表 供应商表增加type类型,区分供应商和客户

This commit is contained in:
15066119699 2025-03-04 10:56:49 +08:00
parent 3d82800c17
commit 810770a8a0
8 changed files with 674 additions and 2 deletions

View File

@ -0,0 +1,104 @@
package com.ruoyi.web.controller.app;
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.app.domain.AppStorage;
import com.ruoyi.app.service.IAppStorageService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 仓库Controller
*
* @author ruoyi
* @date 2025-03-04
*/
@RestController
@RequestMapping("/app/storage")
public class AppStorageController extends BaseController
{
@Autowired
private IAppStorageService appStorageService;
/**
* 查询仓库列表
*/
@PreAuthorize("@ss.hasPermi('app:storage:list')")
@GetMapping("/list")
public TableDataInfo list(AppStorage appStorage)
{
startPage();
List<AppStorage> list = appStorageService.selectAppStorageList(appStorage);
return getDataTable(list);
}
/**
* 导出仓库列表
*/
@PreAuthorize("@ss.hasPermi('app:storage:export')")
@Log(title = "仓库", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppStorage appStorage)
{
List<AppStorage> list = appStorageService.selectAppStorageList(appStorage);
ExcelUtil<AppStorage> util = new ExcelUtil<AppStorage>(AppStorage.class);
util.exportExcel(response, list, "仓库数据");
}
/**
* 获取仓库详细信息
*/
@PreAuthorize("@ss.hasPermi('app:storage:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appStorageService.selectAppStorageById(id));
}
/**
* 新增仓库
*/
@PreAuthorize("@ss.hasPermi('app:storage:add')")
@Log(title = "仓库", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AppStorage appStorage)
{
return toAjax(appStorageService.insertAppStorage(appStorage));
}
/**
* 修改仓库
*/
@PreAuthorize("@ss.hasPermi('app:storage:edit')")
@Log(title = "仓库", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AppStorage appStorage)
{
return toAjax(appStorageService.updateAppStorage(appStorage));
}
/**
* 删除仓库
*/
@PreAuthorize("@ss.hasPermi('app:storage:remove')")
@Log(title = "仓库", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appStorageService.deleteAppStorageByIds(ids));
}
}

View File

@ -45,6 +45,16 @@ public class AppProvider extends BaseEntity
@Excel(name = "最近更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastUpdateTime;
private Integer type;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public void setProviderId(String providerId)
{
this.providerId = providerId;

View File

@ -0,0 +1,209 @@
package com.ruoyi.app.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;
/**
* 仓库对象 app_storage
*
* @author ruoyi
* @date 2025-03-04
*/
public class AppStorage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 厂区 */
@Excel(name = "厂区")
private String factoryId;
/** 所属部门 */
@Excel(name = "所属部门")
private Long deptId;
/** 仓库编号 */
@Excel(name = "仓库编号")
private String storageId;
/** 仓库简称 */
@Excel(name = "仓库简称")
private String storageShortName;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String storageName;
/** 仓库地址 */
@Excel(name = "仓库地址")
private String storageAddress;
/** 仓库联系人名称 */
@Excel(name = "仓库联系人名称")
private String storageConcatsName;
/** 仓库联系人方式 */
@Excel(name = "仓库联系人方式")
private String storageConcatsMobile;
/** 是否为立体库1:立体库 0平库 */
@Excel(name = "是否为立体库1:立体库 0平库")
private String autoStatus;
/** 是否是AGV库 0否 1是 */
@Excel(name = "是否是AGV库 0否 1")
private String isAgv;
/** 是否可用 */
@Excel(name = "是否可用")
private String status;
/** 仓储类型 1AGV 2堆垛机 3穿梭4 人工库 5 其他 */
@Excel(name = "仓储类型 1AGV 2堆垛机 3穿梭4 人工库 5 其他")
private String type;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFactoryId(String factoryId)
{
this.factoryId = factoryId;
}
public String getFactoryId()
{
return factoryId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setStorageId(String storageId)
{
this.storageId = storageId;
}
public String getStorageId()
{
return storageId;
}
public void setStorageShortName(String storageShortName)
{
this.storageShortName = storageShortName;
}
public String getStorageShortName()
{
return storageShortName;
}
public void setStorageName(String storageName)
{
this.storageName = storageName;
}
public String getStorageName()
{
return storageName;
}
public void setStorageAddress(String storageAddress)
{
this.storageAddress = storageAddress;
}
public String getStorageAddress()
{
return storageAddress;
}
public void setStorageConcatsName(String storageConcatsName)
{
this.storageConcatsName = storageConcatsName;
}
public String getStorageConcatsName()
{
return storageConcatsName;
}
public void setStorageConcatsMobile(String storageConcatsMobile)
{
this.storageConcatsMobile = storageConcatsMobile;
}
public String getStorageConcatsMobile()
{
return storageConcatsMobile;
}
public void setAutoStatus(String autoStatus)
{
this.autoStatus = autoStatus;
}
public String getAutoStatus()
{
return autoStatus;
}
public void setIsAgv(String isAgv)
{
this.isAgv = isAgv;
}
public String getIsAgv()
{
return isAgv;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("factoryId", getFactoryId())
.append("deptId", getDeptId())
.append("storageId", getStorageId())
.append("storageShortName", getStorageShortName())
.append("storageName", getStorageName())
.append("storageAddress", getStorageAddress())
.append("storageConcatsName", getStorageConcatsName())
.append("storageConcatsMobile", getStorageConcatsMobile())
.append("autoStatus", getAutoStatus())
.append("isAgv", getIsAgv())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("type", getType())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.mapper;
import java.util.List;
import com.ruoyi.app.domain.AppStorage;
/**
* 仓库Mapper接口
*
* @author ruoyi
* @date 2025-03-04
*/
public interface AppStorageMapper
{
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
public AppStorage selectAppStorageById(Long id);
/**
* 查询仓库列表
*
* @param appStorage 仓库
* @return 仓库集合
*/
public List<AppStorage> selectAppStorageList(AppStorage appStorage);
/**
* 新增仓库
*
* @param appStorage 仓库
* @return 结果
*/
public int insertAppStorage(AppStorage appStorage);
/**
* 修改仓库
*
* @param appStorage 仓库
* @return 结果
*/
public int updateAppStorage(AppStorage appStorage);
/**
* 删除仓库
*
* @param id 仓库主键
* @return 结果
*/
public int deleteAppStorageById(Long id);
/**
* 批量删除仓库
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAppStorageByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.service;
import java.util.List;
import com.ruoyi.app.domain.AppStorage;
/**
* 仓库Service接口
*
* @author ruoyi
* @date 2025-03-04
*/
public interface IAppStorageService
{
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
public AppStorage selectAppStorageById(Long id);
/**
* 查询仓库列表
*
* @param appStorage 仓库
* @return 仓库集合
*/
public List<AppStorage> selectAppStorageList(AppStorage appStorage);
/**
* 新增仓库
*
* @param appStorage 仓库
* @return 结果
*/
public int insertAppStorage(AppStorage appStorage);
/**
* 修改仓库
*
* @param appStorage 仓库
* @return 结果
*/
public int updateAppStorage(AppStorage appStorage);
/**
* 批量删除仓库
*
* @param ids 需要删除的仓库主键集合
* @return 结果
*/
public int deleteAppStorageByIds(Long[] ids);
/**
* 删除仓库信息
*
* @param id 仓库主键
* @return 结果
*/
public int deleteAppStorageById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.app.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppStorageMapper;
import com.ruoyi.app.domain.AppStorage;
import com.ruoyi.app.service.IAppStorageService;
/**
* 仓库Service业务层处理
*
* @author ruoyi
* @date 2025-03-04
*/
@Service
public class AppStorageServiceImpl implements IAppStorageService
{
@Autowired
private AppStorageMapper appStorageMapper;
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
@Override
public AppStorage selectAppStorageById(Long id)
{
return appStorageMapper.selectAppStorageById(id);
}
/**
* 查询仓库列表
*
* @param appStorage 仓库
* @return 仓库
*/
@Override
public List<AppStorage> selectAppStorageList(AppStorage appStorage)
{
return appStorageMapper.selectAppStorageList(appStorage);
}
/**
* 新增仓库
*
* @param appStorage 仓库
* @return 结果
*/
@Override
public int insertAppStorage(AppStorage appStorage)
{
appStorage.setCreateTime(DateUtils.getNowDate());
return appStorageMapper.insertAppStorage(appStorage);
}
/**
* 修改仓库
*
* @param appStorage 仓库
* @return 结果
*/
@Override
public int updateAppStorage(AppStorage appStorage)
{
appStorage.setUpdateTime(DateUtils.getNowDate());
return appStorageMapper.updateAppStorage(appStorage);
}
/**
* 批量删除仓库
*
* @param ids 需要删除的仓库主键
* @return 结果
*/
@Override
public int deleteAppStorageByIds(Long[] ids)
{
return appStorageMapper.deleteAppStorageByIds(ids);
}
/**
* 删除仓库信息
*
* @param id 仓库主键
* @return 结果
*/
@Override
public int deleteAppStorageById(Long id)
{
return appStorageMapper.deleteAppStorageById(id);
}
}

View File

@ -12,10 +12,11 @@
<result property="providerStatus" column="provider_status" />
<result property="lastUpdateUser" column="last_update_user" />
<result property="lastUpdateTime" column="last_update_time" />
<result property="type" column="type" />
</resultMap>
<sql id="selectAppProviderVo">
select provider_id, provider_name, provider_contact, provider_address, provider_status, last_update_user, last_update_time from app_provider
select provider_id, provider_name, provider_contact, provider_address, provider_status, last_update_user, last_update_time,type from app_provider
</sql>
<select id="selectAppProviderList" parameterType="AppProvider" resultMap="AppProviderResult">
@ -27,6 +28,7 @@
<if test="providerStatus != null "> and provider_status = #{providerStatus}</if>
<if test="lastUpdateUser != null and lastUpdateUser != ''"> and last_update_user = #{lastUpdateUser}</if>
<if test="lastUpdateTime != null "> and last_update_time = #{lastUpdateTime}</if>
<if test="type != null "> and type = #{type}</if>
</where>
</select>
@ -45,6 +47,7 @@
<if test="providerStatus != null">provider_status,</if>
<if test="lastUpdateUser != null">last_update_user,</if>
<if test="lastUpdateTime != null">last_update_time,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="providerId != null">#{providerId},</if>
@ -54,6 +57,7 @@
<if test="providerStatus != null">#{providerStatus},</if>
<if test="lastUpdateUser != null">#{lastUpdateUser},</if>
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>

View File

@ -0,0 +1,127 @@
<?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.app.mapper.AppStorageMapper">
<resultMap type="AppStorage" id="AppStorageResult">
<result property="id" column="id" />
<result property="factoryId" column="factory_id" />
<result property="deptId" column="dept_id" />
<result property="storageId" column="storage_id" />
<result property="storageShortName" column="storage_short_name" />
<result property="storageName" column="storage_name" />
<result property="storageAddress" column="storage_address" />
<result property="storageConcatsName" column="storage_concats_name" />
<result property="storageConcatsMobile" column="storage_concats_mobile" />
<result property="autoStatus" column="auto_status" />
<result property="isAgv" column="is_agv" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="type" column="type" />
</resultMap>
<sql id="selectAppStorageVo">
select id, factory_id, dept_id, storage_id, storage_short_name, storage_name, storage_address, storage_concats_name, storage_concats_mobile, auto_status, is_agv, status, create_time, create_by, update_by, update_time, type from app_storage
</sql>
<select id="selectAppStorageList" parameterType="AppStorage" resultMap="AppStorageResult">
<include refid="selectAppStorageVo"/>
<where>
<if test="factoryId != null and factoryId != ''"> and factory_id = #{factoryId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="storageId != null and storageId != ''"> and storage_id = #{storageId}</if>
<if test="storageShortName != null and storageShortName != ''"> and storage_short_name like concat('%', #{storageShortName}, '%')</if>
<if test="storageName != null and storageName != ''"> and storage_name like concat('%', #{storageName}, '%')</if>
<if test="storageAddress != null and storageAddress != ''"> and storage_address = #{storageAddress}</if>
<if test="storageConcatsName != null and storageConcatsName != ''"> and storage_concats_name like concat('%', #{storageConcatsName}, '%')</if>
<if test="storageConcatsMobile != null and storageConcatsMobile != ''"> and storage_concats_mobile = #{storageConcatsMobile}</if>
<if test="autoStatus != null and autoStatus != ''"> and auto_status = #{autoStatus}</if>
<if test="isAgv != null and isAgv != ''"> and is_agv = #{isAgv}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
</where>
</select>
<select id="selectAppStorageById" parameterType="Long" resultMap="AppStorageResult">
<include refid="selectAppStorageVo"/>
where id = #{id}
</select>
<insert id="insertAppStorage" parameterType="AppStorage" useGeneratedKeys="true" keyProperty="id">
insert into app_storage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="factoryId != null">factory_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="storageId != null and storageId != ''">storage_id,</if>
<if test="storageShortName != null">storage_short_name,</if>
<if test="storageName != null and storageName != ''">storage_name,</if>
<if test="storageAddress != null">storage_address,</if>
<if test="storageConcatsName != null">storage_concats_name,</if>
<if test="storageConcatsMobile != null">storage_concats_mobile,</if>
<if test="autoStatus != null">auto_status,</if>
<if test="isAgv != null">is_agv,</if>
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="factoryId != null">#{factoryId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="storageId != null and storageId != ''">#{storageId},</if>
<if test="storageShortName != null">#{storageShortName},</if>
<if test="storageName != null and storageName != ''">#{storageName},</if>
<if test="storageAddress != null">#{storageAddress},</if>
<if test="storageConcatsName != null">#{storageConcatsName},</if>
<if test="storageConcatsMobile != null">#{storageConcatsMobile},</if>
<if test="autoStatus != null">#{autoStatus},</if>
<if test="isAgv != null">#{isAgv},</if>
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<update id="updateAppStorage" parameterType="AppStorage">
update app_storage
<trim prefix="SET" suffixOverrides=",">
<if test="factoryId != null">factory_id = #{factoryId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="storageId != null and storageId != ''">storage_id = #{storageId},</if>
<if test="storageShortName != null">storage_short_name = #{storageShortName},</if>
<if test="storageName != null and storageName != ''">storage_name = #{storageName},</if>
<if test="storageAddress != null">storage_address = #{storageAddress},</if>
<if test="storageConcatsName != null">storage_concats_name = #{storageConcatsName},</if>
<if test="storageConcatsMobile != null">storage_concats_mobile = #{storageConcatsMobile},</if>
<if test="autoStatus != null">auto_status = #{autoStatus},</if>
<if test="isAgv != null">is_agv = #{isAgv},</if>
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppStorageById" parameterType="Long">
delete from app_storage where id = #{id}
</delete>
<delete id="deleteAppStorageByIds" parameterType="String">
delete from app_storage where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>