Commit 9a9aa266 by yubin

仓库,库位管理

parent f3255ab9
import request from '@/utils/request'
// 查询库位列表
export function listLocations(query) {
return request({
url: '/inventory/locations/list',
method: 'get',
params: query
})
}
// 查询库位详细
export function getLocations(id) {
return request({
url: '/inventory/locations/' + id,
method: 'get'
})
}
// 新增库位
export function addLocations(data) {
return request({
url: '/inventory/locations',
method: 'post',
data: data
})
}
// 修改库位
export function updateLocations(data) {
return request({
url: '/inventory/locations',
method: 'put',
data: data
})
}
// 删除库位
export function delLocations(id) {
return request({
url: '/inventory/locations/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询仓库列表
export function listWarehouses(query) {
return request({
url: '/inventory/warehouses/list',
method: 'get',
params: query
})
}
// 查询仓库详细
export function getWarehouses(id) {
return request({
url: '/inventory/warehouses/' + id,
method: 'get'
})
}
// 新增仓库
export function addWarehouses(data) {
return request({
url: '/inventory/warehouses',
method: 'post',
data: data
})
}
// 修改仓库
export function updateWarehouses(data) {
return request({
url: '/inventory/warehouses',
method: 'put',
data: data
})
}
// 删除仓库
export function delWarehouses(id) {
return request({
url: '/inventory/warehouses/' + id,
method: 'delete'
})
}
<template>
<div>
<template v-for="(item, index) in options">
<template v-if="values.includes(item.value)">
<template v-if="values.includes(String(item.value))">
<span
v-if="(item.raw.listClass == 'default' || item.raw.listClass == '') && (item.raw.cssClass == '' || item.raw.cssClass == null)"
:key="item.value"
......@@ -63,7 +63,7 @@ export default {
// 传入值为数组
let unmatch = false // 添加一个标志来判断是否有未匹配项
this.values.forEach(item => {
if (!this.options.some(v => v.value === item)) {
if (!this.options.some(v => String(v.value) === item || v.value === item)) {
this.unmatchArray.push(item)
unmatch = true // 如果有未匹配项,将标志设置为true
}
......
......@@ -99,7 +99,7 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['inventory:owners:import']"
v-hasPermi="['inventory:owners:add']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
......@@ -107,27 +107,27 @@
<el-table v-loading="loading" :data="ownersList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="货主编码" align="center" prop="ownerCode" />
<el-table-column label="货主名称" align="center" prop="ownerName" />
<el-table-column label="货主编码" align="center" prop="ownerCode" width="120"/>
<el-table-column label="货主名称" align="center" prop="ownerName"width="220" />
<el-table-column label="货主类型" align="center" prop="ownerType">
<template slot-scope="scope">
<dict-tag :options="dict.type.owner_type" :value="scope.row.ownerType"/>
</template>
</el-table-column>
<el-table-column label="联系人" align="center" prop="contactPerson" />
<el-table-column label="联系电话" align="center" prop="contactPhone" />
<el-table-column label="邮箱" align="center" prop="email" />
<el-table-column label="地址" align="center" prop="address" />
<el-table-column label="税号" align="center" prop="taxNumber" />
<el-table-column label="银行账户" align="center" prop="bankAccount" />
<el-table-column label="联系电话" align="center" prop="contactPhone" width="120"/>
<el-table-column label="邮箱" align="center" prop="email" width="200"/>
<el-table-column label="地址" align="center" prop="address" width="220"/>
<el-table-column label="税号" align="center" prop="taxNumber"width="180" />
<el-table-column label="银行账户" align="center" prop="bankAccount" width="180"/>
<el-table-column label="是否激活" align="center" prop="isActive">
<template slot-scope="scope">
{{ scope.row.isActive === 1 ? '激活' : '未激活' }}
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_no" :value="scope.row.isActive"/>
</template>
</el-table-column>
<el-table-column label="排序" align="center" prop="sortNo" />
<el-table-column label="创建日期" align="center" prop="createUserCode" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="创建日期" align="center" prop="createTime" width="160" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
<template slot-scope="scope">
<el-button
size="mini"
......
......@@ -19,7 +19,7 @@ public class TreeSelect implements Serializable
private static final long serialVersionUID = 1L;
/** 节点ID */
private Long id;
private String id;
/** 节点名称 */
private String label;
......@@ -38,7 +38,7 @@ public class TreeSelect implements Serializable
public TreeSelect(SysDept dept)
{
this.id = dept.getDeptId();
this.id = String.valueOf(dept.getDeptId());
this.label = dept.getDeptName();
this.disabled = StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus());
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
......@@ -46,17 +46,17 @@ public class TreeSelect implements Serializable
public TreeSelect(SysMenu menu)
{
this.id = menu.getMenuId();
this.id = String.valueOf(menu.getMenuId());
this.label = menu.getMenuName();
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public Long getId()
public String getId()
{
return id;
}
public void setId(Long id)
public void setId(String id)
{
this.id = id;
}
......
......@@ -126,7 +126,9 @@ public class MyBatisConfig
sessionFactory.setDataSource(dataSource);
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
if (StringUtils.isNotBlank(configLocation)) {
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
}
return sessionFactory.getObject();
}
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ public class OwnersController extends BaseController
util.exportExcel(response, list, "货主信息数据");
}
@PreAuthorize("@ss.hasPermi('inventory:owners:import')")
@PreAuthorize("@ss.hasPermi('inventory:owners:add')")
@Log(title = "货主信息", businessType = BusinessType.IMPORT)
@PostMapping("/import")
public AjaxResult importTemplate(MultipartFile file , boolean updateSupport) throws Exception
......
package com.ruoyi.inventory.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.inventory.domain.StorageLocations;
import com.ruoyi.inventory.service.IStorageLocationsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 库位Controller
*
* @author ruoyi
* @date 2025-12-01
*/
@RestController
@RequestMapping("/inventory/locations")
public class StorageLocationsController extends BaseController
{
@Autowired
private IStorageLocationsService storageLocationsService;
/**
* 查询库位列表
*/
@PreAuthorize("@ss.hasPermi('inventory:locations:list')")
@GetMapping("/list")
public TableDataInfo list(StorageLocations storageLocations)
{
startPage();
List<StorageLocations> list = storageLocationsService.selectStorageLocationsList(storageLocations);
return getDataTable(list);
}
/**
* 导出库位列表
*/
@PreAuthorize("@ss.hasPermi('inventory:locations:export')")
@Log(title = "库位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StorageLocations storageLocations)
{
List<StorageLocations> list = storageLocationsService.selectStorageLocationsList(storageLocations);
ExcelUtil<StorageLocations> util = new ExcelUtil<StorageLocations>(StorageLocations.class);
util.exportExcel(response, list, "库位数据");
}
/**
* 获取库位详细信息
*/
@PreAuthorize("@ss.hasPermi('inventory:locations:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(storageLocationsService.selectStorageLocationsById(id));
}
/**
* 新增库位
*/
@PreAuthorize("@ss.hasPermi('inventory:locations:add')")
@Log(title = "库位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody StorageLocations storageLocations)
{
return toAjax(storageLocationsService.insertStorageLocations(storageLocations));
}
/**
* 修改库位
*/
@PreAuthorize("@ss.hasPermi('inventory:locations:edit')")
@Log(title = "库位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody StorageLocations storageLocations)
{
return toAjax(storageLocationsService.updateStorageLocations(storageLocations));
}
/**
* 删除库位
*/
@PreAuthorize("@ss.hasPermi('inventory:locations:remove')")
@Log(title = "库位", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(storageLocationsService.deleteStorageLocationsByIds(ids));
}
}
package com.ruoyi.inventory.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.inventory.domain.Warehouses;
import com.ruoyi.inventory.service.IWarehousesService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 仓库Controller
*
* @author ruoyi
* @date 2025-12-01
*/
@RestController
@RequestMapping("/inventory/warehouses")
public class WarehousesController extends BaseController
{
@Autowired
private IWarehousesService warehousesService;
/**
* 查询仓库列表
*/
@PreAuthorize("@ss.hasPermi('inventory:warehouses:list')")
@GetMapping("/list")
public TableDataInfo list(Warehouses warehouses)
{
startPage();
List<Warehouses> list = warehousesService.selectWarehousesList(warehouses);
return getDataTable(list);
}
/**
* 导出仓库列表
*/
@PreAuthorize("@ss.hasPermi('inventory:warehouses:export')")
@Log(title = "仓库", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Warehouses warehouses)
{
List<Warehouses> list = warehousesService.selectWarehousesList(warehouses);
ExcelUtil<Warehouses> util = new ExcelUtil<Warehouses>(Warehouses.class);
util.exportExcel(response, list, "仓库数据");
}
/**
* 获取仓库详细信息
*/
@PreAuthorize("@ss.hasPermi('inventory:warehouses:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(warehousesService.selectWarehousesById(id));
}
/**
* 新增仓库
*/
@PreAuthorize("@ss.hasPermi('inventory:warehouses:add')")
@Log(title = "仓库", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Warehouses warehouses)
{
return toAjax(warehousesService.insertWarehouses(warehouses));
}
/**
* 修改仓库
*/
@PreAuthorize("@ss.hasPermi('inventory:warehouses:edit')")
@Log(title = "仓库", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Warehouses warehouses)
{
return toAjax(warehousesService.updateWarehouses(warehouses));
}
/**
* 删除仓库
*/
@PreAuthorize("@ss.hasPermi('inventory:warehouses:remove')")
@Log(title = "仓库", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(warehousesService.deleteWarehousesByIds(ids));
}
}
package com.ruoyi.inventory.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;
/**
* 库位对象 storage_locations
*
* @author ruoyi
* @date 2025-12-01
*/
public class StorageLocations extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 库位编码 检索条件 */
@Excel(name = "库位编码 检索条件")
private String locationCode;
/** 库位名称 检索条件 */
@Excel(name = "库位名称 检索条件")
private String locationName;
/** 仓库编码 检索条件 */
@Excel(name = "仓库编码 检索条件")
private String warehousesCode;
/** 库位类型 1-货架 2-地面 3-货位 4-专区 字典设置,检索条件 */
@Excel(name = "库位类型 1-货架 2-地面 3-货位 4-专区 字典设置,检索条件")
private Long locationType;
/** 区域代码 */
@Excel(name = "区域代码")
private String zoneCode;
/** 排 */
@Excel(name = "排")
private String rowCode;
/** 列 */
@Excel(name = "列")
private String columnCode;
/** 层 文字,检索条件 */
@Excel(name = "层 文字,检索条件")
private String layerCode;
/** 库位容量(千克) */
@Excel(name = "库位容量(千克)")
private Long capacity;
/** 体积容量(立方米) */
@Excel(name = "体积容量(立方米)")
private Long volumeCapacity;
/** 允许存放的危险等级(逗号分隔) */
@Excel(name = "允许存放的危险等级", readConverterExp = "逗=号分隔")
private String allowedHazardLevels;
/** 允许存放的分类ID(逗号分隔) */
@Excel(name = "允许存放的分类ID", readConverterExp = "逗=号分隔")
private String allowedCategoryIds;
/** 温区 */
@Excel(name = "温区")
private String temperatureZone;
/** 应用状态1使用0未使用 */
@Excel(name = "应用状态1使用0未使用")
private Long isEnabled;
/** 应用数据1使用0删除 删除用 */
private Long isUsed;
/** 排序 */
private Long sortNo;
/** 创建日期 */
private String createUserCode;
/** 排序号 */
private String updateUserCode;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setLocationCode(String locationCode)
{
this.locationCode = locationCode;
}
public String getLocationCode()
{
return locationCode;
}
public void setLocationName(String locationName)
{
this.locationName = locationName;
}
public String getLocationName()
{
return locationName;
}
public void setWarehousesCode(String warehousesCode)
{
this.warehousesCode = warehousesCode;
}
public String getWarehousesCode()
{
return warehousesCode;
}
public void setLocationType(Long locationType)
{
this.locationType = locationType;
}
public Long getLocationType()
{
return locationType;
}
public void setZoneCode(String zoneCode)
{
this.zoneCode = zoneCode;
}
public String getZoneCode()
{
return zoneCode;
}
public void setRowCode(String rowCode)
{
this.rowCode = rowCode;
}
public String getRowCode()
{
return rowCode;
}
public void setColumnCode(String columnCode)
{
this.columnCode = columnCode;
}
public String getColumnCode()
{
return columnCode;
}
public void setLayerCode(String layerCode)
{
this.layerCode = layerCode;
}
public String getLayerCode()
{
return layerCode;
}
public void setCapacity(Long capacity)
{
this.capacity = capacity;
}
public Long getCapacity()
{
return capacity;
}
public void setVolumeCapacity(Long volumeCapacity)
{
this.volumeCapacity = volumeCapacity;
}
public Long getVolumeCapacity()
{
return volumeCapacity;
}
public void setAllowedHazardLevels(String allowedHazardLevels)
{
this.allowedHazardLevels = allowedHazardLevels;
}
public String getAllowedHazardLevels()
{
return allowedHazardLevels;
}
public void setAllowedCategoryIds(String allowedCategoryIds)
{
this.allowedCategoryIds = allowedCategoryIds;
}
public String getAllowedCategoryIds()
{
return allowedCategoryIds;
}
public void setTemperatureZone(String temperatureZone)
{
this.temperatureZone = temperatureZone;
}
public String getTemperatureZone()
{
return temperatureZone;
}
public void setIsEnabled(Long isEnabled)
{
this.isEnabled = isEnabled;
}
public Long getIsEnabled()
{
return isEnabled;
}
public void setIsUsed(Long isUsed)
{
this.isUsed = isUsed;
}
public Long getIsUsed()
{
return isUsed;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("locationCode", getLocationCode())
.append("locationName", getLocationName())
.append("warehousesCode", getWarehousesCode())
.append("locationType", getLocationType())
.append("zoneCode", getZoneCode())
.append("rowCode", getRowCode())
.append("columnCode", getColumnCode())
.append("layerCode", getLayerCode())
.append("capacity", getCapacity())
.append("volumeCapacity", getVolumeCapacity())
.append("allowedHazardLevels", getAllowedHazardLevels())
.append("allowedCategoryIds", getAllowedCategoryIds())
.append("temperatureZone", getTemperatureZone())
.append("isEnabled", getIsEnabled())
.append("isUsed", getIsUsed())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
package com.ruoyi.inventory.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;
/**
* 库位存放分类对象 storage_locations_category
*
* @author ruoyi
* @date 2025-12-01
*/
public class StorageLocationsCategory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 库位编码 */
@Excel(name = "库位编码")
private String locationCode;
/** 仓库编码 */
@Excel(name = "仓库编码")
private String warehousesCode;
/** 分类编码 */
@Excel(name = "分类编码")
private String categoryId;
/** 分类名称 */
@Excel(name = "分类名称")
private String categoryName;
/** 排序 暂无用 */
@Excel(name = "排序 暂无用")
private Long sortNo;
/** 创建日期 */
@Excel(name = "创建日期")
private String createUserCode;
/** 排序号 */
@Excel(name = "排序号")
private String updateUserCode;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setLocationCode(String locationCode)
{
this.locationCode = locationCode;
}
public String getLocationCode()
{
return locationCode;
}
public void setWarehousesCode(String warehousesCode)
{
this.warehousesCode = warehousesCode;
}
public String getWarehousesCode()
{
return warehousesCode;
}
public void setCategoryId(String categoryId)
{
this.categoryId = categoryId;
}
public String getCategoryId()
{
return categoryId;
}
public void setCategoryName(String categoryName)
{
this.categoryName = categoryName;
}
public String getCategoryName()
{
return categoryName;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("locationCode", getLocationCode())
.append("warehousesCode", getWarehousesCode())
.append("categoryId", getCategoryId())
.append("categoryName", getCategoryName())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
package com.ruoyi.inventory.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;
/**
* 仓库对象 warehouses
*
* @author ruoyi
* @date 2025-12-01
*/
public class Warehouses extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 仓库编码 检索条件 */
@Excel(name = "仓库编码 检索条件")
private String warehousesCode;
/** 仓库名称 检索条件 */
@Excel(name = "仓库名称 检索条件")
private String warehousesName;
/** 仓库类型1-普通仓 2-危险品仓 3-冷藏仓 字典设置,检索条件 */
@Excel(name = "仓库类型1-普通仓 2-危险品仓 3-冷藏仓 字典设置,检索条件")
private Long warehouseType;
/** 仓库地点 检索条件 */
@Excel(name = "仓库地点 检索条件")
private String address;
/** 仓库区域 */
@Excel(name = "仓库区域")
private Long area;
/** 仓库容量 */
@Excel(name = "仓库容量")
private Long capacity;
/** 仓库管理员 文字,检索条件 */
@Excel(name = "仓库管理员 文字,检索条件")
private String manager;
/** 联系电话 */
@Excel(name = "联系电话")
private String contactPhone;
/** 应用状态1使用0未使用 */
@Excel(name = "应用状态1使用0未使用")
private Long isEnabled;
/** 应用数据1使用0删除 删除用 */
@Excel(name = "应用数据1使用0删除 删除用")
private Long isUsed;
/** 排序 */
@Excel(name = "排序")
private Long sortNo;
/** 创建日期 */
private String createUserCode;
/** 排序号 */
private String updateUserCode;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setWarehousesCode(String warehousesCode)
{
this.warehousesCode = warehousesCode;
}
public String getWarehousesCode()
{
return warehousesCode;
}
public void setWarehousesName(String warehousesName)
{
this.warehousesName = warehousesName;
}
public String getWarehousesName()
{
return warehousesName;
}
public void setWarehouseType(Long warehouseType)
{
this.warehouseType = warehouseType;
}
public Long getWarehouseType()
{
return warehouseType;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setArea(Long area)
{
this.area = area;
}
public Long getArea()
{
return area;
}
public void setCapacity(Long capacity)
{
this.capacity = capacity;
}
public Long getCapacity()
{
return capacity;
}
public void setManager(String manager)
{
this.manager = manager;
}
public String getManager()
{
return manager;
}
public void setContactPhone(String contactPhone)
{
this.contactPhone = contactPhone;
}
public String getContactPhone()
{
return contactPhone;
}
public void setIsEnabled(Long isEnabled)
{
this.isEnabled = isEnabled;
}
public Long getIsEnabled()
{
return isEnabled;
}
public void setIsUsed(Long isUsed)
{
this.isUsed = isUsed;
}
public Long getIsUsed()
{
return isUsed;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("warehousesCode", getWarehousesCode())
.append("warehousesName", getWarehousesName())
.append("warehouseType", getWarehouseType())
.append("address", getAddress())
.append("area", getArea())
.append("capacity", getCapacity())
.append("manager", getManager())
.append("contactPhone", getContactPhone())
.append("isEnabled", getIsEnabled())
.append("isUsed", getIsUsed())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
......@@ -2,6 +2,7 @@ package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.inventory.domain.Materials;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
......@@ -10,6 +11,7 @@ import org.apache.ibatis.annotations.Param;
* @author ruoyi
* @date 2025-11-28
*/
@Mapper
public interface MaterialsMapper
{
/**
......
package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.inventory.domain.StorageLocationsCategory;
import org.apache.ibatis.annotations.Update;
/**
* 库位存放分类Mapper接口
*
* @author ruoyi
* @date 2025-12-01
*/
public interface StorageLocationsCategoryMapper
{
/**
* 查询库位存放分类
*
* @param id 库位存放分类主键
* @return 库位存放分类
*/
public StorageLocationsCategory selectStorageLocationsCategoryById(String id);
/**
* 查询库位存放分类列表
*
* @param storageLocationsCategory 库位存放分类
* @return 库位存放分类集合
*/
public List<StorageLocationsCategory> selectStorageLocationsCategoryList(StorageLocationsCategory storageLocationsCategory);
/**
* 新增库位存放分类
*
* @param storageLocationsCategory 库位存放分类
* @return 结果
*/
public int insertStorageLocationsCategory(StorageLocationsCategory storageLocationsCategory);
/**
* 修改库位存放分类
*
* @param storageLocationsCategory 库位存放分类
* @return 结果
*/
public int updateStorageLocationsCategory(StorageLocationsCategory storageLocationsCategory);
/**
* 删除库位存放分类
*
* @param id 库位存放分类主键
* @return 结果
*/
public int deleteStorageLocationsCategoryById(String id);
/**
* 删除库位存放分类
*
* @param locationCode 库位存放分类主键
* @return 结果
*/
public int deleteStorageLocationsCategoryByLocationCode(String locationCode);
/**
* 批量删除库位存放分类
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteStorageLocationsCategoryByIds(String[] ids);
/**
* 修改库位状态
*
* @param id 需要删除的数据主键集合
* @return 结果
*/
@Update("update storage_locations_category set is_enabled = 0 where warehouses_code=#{id}")
public int updateStorageLocationsCategoryStatus(String id);
}
package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.inventory.domain.StorageLocations;
import org.apache.ibatis.annotations.Update;
/**
* 库位Mapper接口
*
* @author ruoyi
* @date 2025-12-01
*/
public interface StorageLocationsMapper
{
/**
* 查询库位
*
* @param id 库位主键
* @return 库位
*/
public StorageLocations selectStorageLocationsById(String id);
/**
* 查询库位列表
*
* @param storageLocations 库位
* @return 库位集合
*/
public List<StorageLocations> selectStorageLocationsList(StorageLocations storageLocations);
/**
* 新增库位
*
* @param storageLocations 库位
* @return 结果
*/
public int insertStorageLocations(StorageLocations storageLocations);
/**
* 修改库位
*
* @param storageLocations 库位
* @return 结果
*/
public int updateStorageLocations(StorageLocations storageLocations);
/**
* 删除库位
*
* @param id 库位主键
* @return 结果
*/
public int deleteStorageLocationsById(String id);
/**
* 批量删除库位
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteStorageLocationsByIds(String[] ids);
/**
* 查询库位
*
* @param warehousesCode 库位主键
* @return 库位
*/
public List<StorageLocations> selectStorageLocationsByWarehousesCode(String warehousesCode);
/**
* 查询库位
*
* @param warehousesCode 库位主键
* @return 库位
*/
public List<StorageLocations> selectStorageLocationsByWarehousesCodes(String[] warehousesCode);
@Update("update storage_locations set is_enabled = 0 where warehouses_code=#{id}")
public int updateStorageLocationsStatus(String id);
}
package com.ruoyi.inventory.mapper;
import java.util.List;
import com.ruoyi.inventory.domain.Warehouses;
import org.apache.ibatis.annotations.Update;
/**
* 仓库Mapper接口
*
* @author ruoyi
* @date 2025-12-01
*/
public interface WarehousesMapper
{
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
public Warehouses selectWarehousesById(String id);
/**
* 查询仓库列表
*
* @param warehouses 仓库
* @return 仓库集合
*/
public List<Warehouses> selectWarehousesList(Warehouses warehouses);
/**
* 新增仓库
*
* @param warehouses 仓库
* @return 结果
*/
public int insertWarehouses(Warehouses warehouses);
/**
* 修改仓库
*
* @param warehouses 仓库
* @return 结果
*/
public int updateWarehouses(Warehouses warehouses);
/**
* 删除仓库
*
* @param id 仓库主键
* @return 结果
*/
public int deleteWarehousesById(String id);
/**
* 批量删除仓库
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWarehousesByIds(String[] ids);
/**
* 批量删除仓库
*
* @param id 需要删除的数据主键集合
* @return 结果
*/
@Update("update warehouses set is_enabled = 0 where id=#{id}")
public int updateWarehouseStatus(String id);
}
package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.StorageLocationsCategory;
/**
* 库位存放分类Service接口
*
* @author ruoyi
* @date 2025-12-01
*/
public interface IStorageLocationsCategoryService
{
/**
* 查询库位存放分类
*
* @param id 库位存放分类主键
* @return 库位存放分类
*/
public StorageLocationsCategory selectStorageLocationsCategoryById(String id);
/**
* 查询库位存放分类列表
*
* @param storageLocationsCategory 库位存放分类
* @return 库位存放分类集合
*/
public List<StorageLocationsCategory> selectStorageLocationsCategoryList(StorageLocationsCategory storageLocationsCategory);
/**
* 新增库位存放分类
*
* @param storageLocationsCategory 库位存放分类
* @return 结果
*/
public int insertStorageLocationsCategory(StorageLocationsCategory storageLocationsCategory);
/**
* 修改库位存放分类
*
* @param storageLocationsCategory 库位存放分类
* @return 结果
*/
public int updateStorageLocationsCategory(StorageLocationsCategory storageLocationsCategory);
/**
* 批量删除库位存放分类
*
* @param ids 需要删除的库位存放分类主键集合
* @return 结果
*/
public int deleteStorageLocationsCategoryByIds(String[] ids);
/**
* 删除库位存放分类信息
*
* @param id 库位存放分类主键
* @return 结果
*/
public int deleteStorageLocationsCategoryById(String id);
}
package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.StorageLocations;
/**
* 库位Service接口
*
* @author ruoyi
* @date 2025-12-01
*/
public interface IStorageLocationsService
{
/**
* 查询库位
*
* @param id 库位主键
* @return 库位
*/
public StorageLocations selectStorageLocationsById(String id);
/**
* 查询库位
*
* @param warehousesCode 库位主键
* @return 库位
*/
public List<StorageLocations> selectStorageLocationsByWarehousesCode(String warehousesCode);
/**
* 查询库位
*
* @param warehousesCodes 库位主键
* @return 库位
*/
public List<StorageLocations> selectStorageLocationsByWarehousesCodes(String[] warehousesCodes);
/**
* 查询库位列表
*
* @param storageLocations 库位
* @return 库位集合
*/
public List<StorageLocations> selectStorageLocationsList(StorageLocations storageLocations);
/**
* 新增库位
*
* @param storageLocations 库位
* @return 结果
*/
public int insertStorageLocations(StorageLocations storageLocations);
/**
* 修改库位
*
* @param storageLocations 库位
* @return 结果
*/
public int updateStorageLocations(StorageLocations storageLocations);
/**
* 批量删除库位
*
* @param ids 需要删除的库位主键集合
* @return 结果
*/
public int deleteStorageLocationsByIds(String[] ids);
/**
* 删除库位信息
*
* @param id 库位主键
* @return 结果
*/
public int deleteStorageLocationsById(String id);
int updateLocationsCategoryStatus(String id);
}
package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.Warehouses;
/**
* 仓库Service接口
*
* @author ruoyi
* @date 2025-12-01
*/
public interface IWarehousesService
{
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
public Warehouses selectWarehousesById(String id);
/**
* 查询仓库列表
*
* @param warehouses 仓库
* @return 仓库集合
*/
public List<Warehouses> selectWarehousesList(Warehouses warehouses);
/**
* 新增仓库
*
* @param warehouses 仓库
* @return 结果
*/
public int insertWarehouses(Warehouses warehouses);
/**
* 修改仓库
*
* @param warehouses 仓库
* @return 结果
*/
public int updateWarehouses(Warehouses warehouses);
int updateWarehouseStatus(Warehouses warehouses);
/**
* 批量删除仓库
*
* @param ids 需要删除的仓库主键集合
* @return 结果
*/
public int deleteWarehousesByIds(String[] ids);
/**
* 删除仓库信息
*
* @param id 仓库主键
* @return 结果
*/
public int deleteWarehousesById(String id);
}
......@@ -123,11 +123,8 @@ public class MaterialsServiceImpl implements IMaterialsService
// 填充创建人、创建时间、修改人、修改时间
materials.setCreateBy(operId);
materials.setCreateTime(now);
materials.setUpdateBy(operId);
materials.setUpdateTime(now);
// 填充创建用户编码和更新用户编码
materials.setCreateUserCode(operId);
materials.setUpdateUserCode(operId);
// 设置默认值
if (materials.getIsActive() == null)
{
......
......@@ -109,11 +109,8 @@ public class OwnersServiceImpl implements IOwnersService
// 填充创建人、创建时间、修改人、修改时间
owners.setCreateBy(operId);
owners.setCreateTime(now);
owners.setUpdateBy(operId);
owners.setUpdateTime(now);
// 填充创建用户编码和更新用户编码
owners.setCreateUserCode(operId);
owners.setUpdateUserCode(operId);
// 设置默认值
if (owners.getIsActive() == null)
{
......
package com.ruoyi.inventory.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.inventory.mapper.StorageLocationsCategoryMapper;
import com.ruoyi.inventory.domain.StorageLocationsCategory;
import com.ruoyi.inventory.service.IStorageLocationsCategoryService;
/**
* 库位存放分类Service业务层处理
*
* @author ruoyi
* @date 2025-12-01
*/
@Service
public class StorageLocationsCategoryServiceImpl implements IStorageLocationsCategoryService
{
@Autowired
private StorageLocationsCategoryMapper storageLocationsCategoryMapper;
/**
* 查询库位存放分类
*
* @param id 库位存放分类主键
* @return 库位存放分类
*/
@Override
public StorageLocationsCategory selectStorageLocationsCategoryById(String id)
{
return storageLocationsCategoryMapper.selectStorageLocationsCategoryById(id);
}
/**
* 查询库位存放分类列表
*
* @param storageLocationsCategory 库位存放分类
* @return 库位存放分类
*/
@Override
public List<StorageLocationsCategory> selectStorageLocationsCategoryList(StorageLocationsCategory storageLocationsCategory)
{
return storageLocationsCategoryMapper.selectStorageLocationsCategoryList(storageLocationsCategory);
}
/**
* 新增库位存放分类
*
* @param storageLocationsCategory 库位存放分类
* @return 结果
*/
@Override
public int insertStorageLocationsCategory(StorageLocationsCategory storageLocationsCategory)
{
storageLocationsCategory.setCreateTime(DateUtils.getNowDate());
return storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory);
}
/**
* 修改库位存放分类
*
* @param storageLocationsCategory 库位存放分类
* @return 结果
*/
@Override
public int updateStorageLocationsCategory(StorageLocationsCategory storageLocationsCategory)
{
storageLocationsCategory.setUpdateTime(DateUtils.getNowDate());
return storageLocationsCategoryMapper.updateStorageLocationsCategory(storageLocationsCategory);
}
/**
* 批量删除库位存放分类
*
* @param ids 需要删除的库位存放分类主键
* @return 结果
*/
@Override
public int deleteStorageLocationsCategoryByIds(String[] ids)
{
return storageLocationsCategoryMapper.deleteStorageLocationsCategoryByIds(ids);
}
/**
* 删除库位存放分类信息
*
* @param id 库位存放分类主键
* @return 结果
*/
@Override
public int deleteStorageLocationsCategoryById(String id)
{
return storageLocationsCategoryMapper.deleteStorageLocationsCategoryById(id);
}
}
package com.ruoyi.inventory.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.inventory.domain.MaterialsCategory;
import com.ruoyi.inventory.domain.StorageLocationsCategory;
import com.ruoyi.inventory.mapper.MaterialsCategoryMapper;
import com.ruoyi.inventory.mapper.StorageLocationsCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.StorageLocationsMapper;
import com.ruoyi.inventory.domain.StorageLocations;
import com.ruoyi.inventory.service.IStorageLocationsService;
/**
* 库位Service业务层处理
*
* @author ruoyi
* @date 2025-12-01
*/
@Service
public class StorageLocationsServiceImpl implements IStorageLocationsService
{
@Autowired
private StorageLocationsMapper storageLocationsMapper;
@Autowired
private StorageLocationsCategoryMapper storageLocationsCategoryMapper;
@Autowired
private MaterialsCategoryMapper materialsCategoryMapper;
/**
* 查询库位
*
* @param id 库位主键
* @return 库位
*/
@Override
public StorageLocations selectStorageLocationsById(String id)
{
return storageLocationsMapper.selectStorageLocationsById(id);
}
@Override
public List<StorageLocations> selectStorageLocationsByWarehousesCode(String warehousesCode) {
return storageLocationsMapper.selectStorageLocationsByWarehousesCode(warehousesCode);
}
@Override
public List<StorageLocations> selectStorageLocationsByWarehousesCodes(String[] warehousesCodes) {
return storageLocationsMapper.selectStorageLocationsByWarehousesCodes(warehousesCodes);
}
/**
* 查询库位列表
*
* @param storageLocations 库位
* @return 库位
*/
@Override
public List<StorageLocations> selectStorageLocationsList(StorageLocations storageLocations)
{
return storageLocationsMapper.selectStorageLocationsList(storageLocations);
}
/**
* 新增库位
*
* @param storageLocations 库位
* @return 结果
*/
@Override
public int insertStorageLocations(StorageLocations storageLocations)
{
storageLocations.setCreateTime(DateUtils.getNowDate());
StorageLocationsCategory storageLocationsCategory = new StorageLocationsCategory();
BeanUtils.copyBeanProp(storageLocations,storageLocationsCategory);
String LocationsID = UUID.randomUUID().toString();
storageLocations.setId(LocationsID);
storageLocations.setCreateTime(DateUtils.getNowDate());
storageLocations.setCreateUserCode(String.valueOf(SecurityUtils.getUserId()));
storageLocationsCategory.setLocationCode(LocationsID);
String[] CategoryId = storageLocations.getAllowedCategoryIds().split(",");
for (String categoryId : CategoryId) {
storageLocationsCategory.setId(java.util.UUID.randomUUID().toString());
storageLocationsCategory.setCategoryId(categoryId);
storageLocationsCategory.setCreateTime(DateUtils.getNowDate());
storageLocationsCategory.setCreateUserCode(String.valueOf(SecurityUtils.getUserId()));
MaterialsCategory materialsCategory = materialsCategoryMapper.selectMaterialsCategoryById(categoryId);
storageLocationsCategory.setCategoryName(materialsCategory.getCategoryName());
storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory);
}
return storageLocationsMapper.insertStorageLocations(storageLocations);
}
/**
* 修改库位
*
* @param storageLocations 库位
* @return 结果
*/
@Override
public int updateStorageLocations(StorageLocations storageLocations)
{
storageLocations.setUpdateTime(DateUtils.getNowDate());
storageLocations.setUpdateUserCode(String.valueOf(SecurityUtils.getUserId()));
String LocationsID = storageLocations.getId();
String LocationsCode = storageLocations.getLocationCode();
StorageLocations storageLocations1 = storageLocationsMapper.selectStorageLocationsById(LocationsID);
if (storageLocations1.getAllowedCategoryIds()!=storageLocations.getAllowedCategoryIds()||storageLocations1.getIsEnabled()!=storageLocations.getIsEnabled()){
storageLocationsCategoryMapper.deleteStorageLocationsCategoryByLocationCode(LocationsID);
String[] CategoryId = storageLocations.getAllowedCategoryIds().split(",");
StorageLocationsCategory storageLocationsCategory = new StorageLocationsCategory();
BeanUtils.copyBeanProp(storageLocations,storageLocationsCategory);
storageLocationsCategory.setLocationCode(LocationsID);
for (String categoryId : CategoryId) {
storageLocations.setId(java.util.UUID.randomUUID().toString());
storageLocationsCategory.setCategoryId(categoryId);
storageLocationsCategory.setUpdateTime(DateUtils.getNowDate());
storageLocationsCategory.setUpdateUserCode(String.valueOf(SecurityUtils.getUserId()));
MaterialsCategory materialsCategory = materialsCategoryMapper.selectMaterialsCategoryById(categoryId);
storageLocationsCategory.setCategoryName(materialsCategory.getCategoryName());
storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory);
}
}
return storageLocationsMapper.updateStorageLocations(storageLocations);
}
/**
* 批量删除库位
*
* @param ids 需要删除的库位主键
* @return 结果
*/
@Override
public int deleteStorageLocationsByIds(String[] ids)
{
storageLocationsCategoryMapper.deleteStorageLocationsCategoryByIds(ids);
return storageLocationsMapper.deleteStorageLocationsByIds(ids);
}
/**
* 删除库位信息
*
* @param id 库位主键
* @return 结果
*/
@Override
public int deleteStorageLocationsById(String id)
{
storageLocationsCategoryMapper.deleteStorageLocationsCategoryById(id);
return storageLocationsMapper.deleteStorageLocationsById(id);
}
@Override
public int updateLocationsCategoryStatus(String id)
{
storageLocationsCategoryMapper.updateStorageLocationsCategoryStatus(id);
return storageLocationsMapper.updateStorageLocationsStatus(id);
}
}
package com.ruoyi.inventory.service.impl;
import java.util.List;
import java.util.UUID;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.inventory.domain.StorageLocations;
import com.ruoyi.inventory.service.IWarehousesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.WarehousesMapper;
import com.ruoyi.inventory.domain.Warehouses;
/**
* 仓库Service业务层处理
*
* @author ruoyi
* @date 2025-12-01
*/
@Service
public class WarehousesServiceImpl implements IWarehousesService
{
@Autowired
private WarehousesMapper warehousesMapper;
@Autowired
private StorageLocationsServiceImpl storageLocationsService;
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
@Override
public Warehouses selectWarehousesById(String id)
{
return warehousesMapper.selectWarehousesById(id);
}
/**
* 查询仓库列表
*
* @param warehouses 仓库
* @return 仓库
*/
@Override
public List<Warehouses> selectWarehousesList(Warehouses warehouses)
{
return warehousesMapper.selectWarehousesList(warehouses);
}
/**
* 新增仓库
*
* @param warehouses 仓库
* @return 结果
*/
@Override
public int insertWarehouses(Warehouses warehouses)
{
warehouses.setCreateTime(DateUtils.getNowDate());
warehouses.setCreateUserCode(String.valueOf(SecurityUtils.getUserId()));
warehouses.setId(UUID.randomUUID().toString());
return warehousesMapper.insertWarehouses(warehouses);
}
/**
* 修改仓库
*
* @param warehouses 仓库
* @return 结果
*/
@Override
public int updateWarehouses(Warehouses warehouses)
{
warehouses.setUpdateUserCode(String.valueOf(SecurityUtils.getUserId()));
warehouses.setUpdateTime(DateUtils.getNowDate());
Warehouses warehouses1 = warehousesMapper.selectWarehousesById(warehouses.getId());
if (warehouses1.getIsEnabled()!=warehouses.getIsEnabled()){
updateWarehouseStatus(warehouses);
}
return warehousesMapper.updateWarehouses(warehouses);
}
@Override
public int updateWarehouseStatus(Warehouses warehouses)
{
storageLocationsService.updateLocationsCategoryStatus(warehouses.getWarehousesCode());
return warehousesMapper.updateWarehouseStatus(warehouses.getId());
}
/**
* 批量删除仓库
*
* @param ids 需要删除的仓库主键
* @return 结果
*/
@Override
public int deleteWarehousesByIds(String[] ids)
{
List<StorageLocations> storageLocations = storageLocationsService.selectStorageLocationsByWarehousesCodes(ids);
for (StorageLocations storageLocation : storageLocations) {
storageLocationsService.deleteStorageLocationsById(storageLocation.getId());
}
return warehousesMapper.deleteWarehousesByIds(ids);
}
/**
* 删除仓库信息
*
* @param id 仓库主键
* @return 结果
*/
@Override
public int deleteWarehousesById(String id)
{
List<StorageLocations> storageLocations = storageLocationsService.selectStorageLocationsByWarehousesCode(id);
for (StorageLocations storageLocation : storageLocations) {
storageLocationsService.deleteStorageLocationsById(storageLocation.getId());
}
return warehousesMapper.deleteWarehousesById(id);
}
}
<?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.inventory.mapper.StorageLocationsCategoryMapper">
<resultMap type="StorageLocationsCategory" id="StorageLocationsCategoryResult">
<result property="id" column="id" />
<result property="locationCode" column="location_code" />
<result property="warehousesCode" column="warehouses_code" />
<result property="categoryId" column="category_id" />
<result property="categoryName" column="category_name" />
<result property="sortNo" column="sort_no" />
<result property="createTime" column="create_time" />
<result property="createUserCode" column="create_user_code" />
<result property="updateTime" column="update_time" />
<result property="updateUserCode" column="update_user_code" />
</resultMap>
<sql id="selectStorageLocationsCategoryVo">
select id, location_code, warehouses_code, category_id, category_name, sort_no, create_time, create_user_code, update_time, update_user_code from storage_locations_category
</sql>
<select id="selectStorageLocationsCategoryList" parameterType="StorageLocationsCategory" resultMap="StorageLocationsCategoryResult">
<include refid="selectStorageLocationsCategoryVo"/>
<where>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="warehousesCode != null and warehousesCode != ''"> and warehouses_code = #{warehousesCode}</if>
<if test="categoryId != null and categoryId != ''"> and category_id = #{categoryId}</if>
<if test="categoryName != null and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
<if test="createUserCode != null and createUserCode != ''"> and create_user_code = #{createUserCode}</if>
<if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if>
</where>
</select>
<select id="selectStorageLocationsCategoryById" parameterType="String" resultMap="StorageLocationsCategoryResult">
<include refid="selectStorageLocationsCategoryVo"/>
where id = #{id}
</select>
<insert id="insertStorageLocationsCategory" parameterType="StorageLocationsCategory">
insert into storage_locations_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="locationCode != null">location_code,</if>
<if test="warehousesCode != null">warehouses_code,</if>
<if test="categoryId != null">category_id,</if>
<if test="categoryName != null">category_name,</if>
<if test="sortNo != null">sort_no,</if>
<if test="createTime != null">create_time,</if>
<if test="createUserCode != null">create_user_code,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateUserCode != null">update_user_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="locationCode != null">#{locationCode},</if>
<if test="warehousesCode != null">#{warehousesCode},</if>
<if test="categoryId != null">#{categoryId},</if>
<if test="categoryName != null">#{categoryName},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createUserCode != null">#{createUserCode},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateUserCode != null">#{updateUserCode},</if>
</trim>
</insert>
<update id="updateStorageLocationsCategory" parameterType="StorageLocationsCategory">
update storage_locations_category
<trim prefix="SET" suffixOverrides=",">
<if test="locationCode != null">location_code = #{locationCode},</if>
<if test="warehousesCode != null">warehouses_code = #{warehousesCode},</if>
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="categoryName != null">category_name = #{categoryName},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createUserCode != null">create_user_code = #{createUserCode},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateUserCode != null">update_user_code = #{updateUserCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteStorageLocationsCategoryById" parameterType="String">
update storage_locations_category set is_used = 0 where id= #{id}
</delete>
<delete id="deleteStorageLocationsCategoryByIds" parameterType="String">
update storage_locations_category set is_used = 0 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.inventory.mapper.WarehousesMapper">
<resultMap type="Warehouses" id="WarehousesResult">
<result property="id" column="id" />
<result property="warehousesCode" column="warehouses_code" />
<result property="warehousesName" column="warehouses_name" />
<result property="warehouseType" column="warehouse_type" />
<result property="address" column="address" />
<result property="area" column="area" />
<result property="capacity" column="capacity" />
<result property="manager" column="manager" />
<result property="contactPhone" column="contact_phone" />
<result property="isEnabled" column="is_enabled" />
<result property="isUsed" column="is_used" />
<result property="sortNo" column="sort_no" />
<result property="createTime" column="create_time" />
<result property="createUserCode" column="create_user_code" />
<result property="updateTime" column="update_time" />
<result property="updateUserCode" column="update_user_code" />
</resultMap>
<sql id="selectWarehousesVo">
select id, warehouses_code, warehouses_name, warehouse_type, address, area, capacity, manager, contact_phone, is_enabled, is_used, sort_no, create_time, create_user_code, update_time, update_user_code from warehouses
</sql>
<select id="selectWarehousesList" parameterType="Warehouses" resultMap="WarehousesResult">
<include refid="selectWarehousesVo"/>
<where>
<if test="warehousesCode != null and warehousesCode != ''"> and warehouses_code = #{warehousesCode}</if>
<if test="warehousesName != null and warehousesName != ''"> and warehouses_name like concat('%', #{warehousesName}, '%')</if>
<if test="warehouseType != null "> and warehouse_type = #{warehouseType}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="area != null "> and area = #{area}</if>
<if test="capacity != null "> and capacity = #{capacity}</if>
<if test="manager != null and manager != ''"> and manager = #{manager}</if>
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
<if test="isEnabled != null "> and is_enabled = #{isEnabled}</if>
<if test="isUsed != null "> and is_used = #{isUsed}</if>
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
<if test="createUserCode != null and createUserCode != ''"> and create_user_code = #{createUserCode}</if>
<if test="updateUserCode != null and updateUserCode != ''"> and update_user_code = #{updateUserCode}</if>
</where>
</select>
<select id="selectWarehousesById" parameterType="String" resultMap="WarehousesResult">
<include refid="selectWarehousesVo"/>
where id = #{id}
</select>
<insert id="insertWarehouses" parameterType="Warehouses">
insert into warehouses
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="warehousesCode != null">warehouses_code,</if>
<if test="warehousesName != null">warehouses_name,</if>
<if test="warehouseType != null">warehouse_type,</if>
<if test="address != null">address,</if>
<if test="area != null">area,</if>
<if test="capacity != null">capacity,</if>
<if test="manager != null">manager,</if>
<if test="contactPhone != null">contact_phone,</if>
<if test="isEnabled != null">is_enabled,</if>
<if test="isUsed != null">is_used,</if>
<if test="sortNo != null">sort_no,</if>
<if test="createTime != null">create_time,</if>
<if test="createUserCode != null">create_user_code,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateUserCode != null">update_user_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="warehousesCode != null">#{warehousesCode},</if>
<if test="warehousesName != null">#{warehousesName},</if>
<if test="warehouseType != null">#{warehouseType},</if>
<if test="address != null">#{address},</if>
<if test="area != null">#{area},</if>
<if test="capacity != null">#{capacity},</if>
<if test="manager != null">#{manager},</if>
<if test="contactPhone != null">#{contactPhone},</if>
<if test="isEnabled != null">#{isEnabled},</if>
<if test="isUsed != null">#{isUsed},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createUserCode != null">#{createUserCode},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateUserCode != null">#{updateUserCode},</if>
</trim>
</insert>
<update id="updateWarehouses" parameterType="Warehouses">
update warehouses
<trim prefix="SET" suffixOverrides=",">
<if test="warehousesCode != null">warehouses_code = #{warehousesCode},</if>
<if test="warehousesName != null">warehouses_name = #{warehousesName},</if>
<if test="warehouseType != null">warehouse_type = #{warehouseType},</if>
<if test="address != null">address = #{address},</if>
<if test="area != null">area = #{area},</if>
<if test="capacity != null">capacity = #{capacity},</if>
<if test="manager != null">manager = #{manager},</if>
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
<if test="isEnabled != null">is_enabled = #{isEnabled},</if>
<if test="isUsed != null">is_used = #{isUsed},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createUserCode != null">create_user_code = #{createUserCode},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateUserCode != null">update_user_code = #{updateUserCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWarehousesById" parameterType="String">
delete from warehouses where id = #{id}
</delete>
<delete id="deleteWarehousesByIds" parameterType="String">
delete from warehouses where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论