初始化

This commit is contained in:
张怡蓉
2025-12-23 13:36:18 +08:00
commit d427ebf6d0
1232 changed files with 239447 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
package com.ruoyi.stock.freeze.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.stock.freeze.domain.BasStockFreezeRecord;
import com.ruoyi.stock.freeze.service.IBasStockFreezeRecordService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 库存冻结记录Controller
*
* @author ruoyi
* @date 2025-05-28
*/
@RestController
@RequestMapping("/stock/freeze")
public class BasStockFreezeRecordController extends BaseController
{
@Autowired
private IBasStockFreezeRecordService basStockFreezeRecordService;
/**
* 查询库存冻结记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:freeze:list')")
@GetMapping("/list")
public TableDataInfo list(BasStockFreezeRecord basStockFreezeRecord)
{
startPage();
List<BasStockFreezeRecord> list = basStockFreezeRecordService.selectBasStockFreezeRecordList(basStockFreezeRecord);
return getDataTable(list);
}
/**
* 导出库存冻结记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:freeze:export')")
@Log(title = "库存冻结记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasStockFreezeRecord basStockFreezeRecord)
{
List<BasStockFreezeRecord> list = basStockFreezeRecordService.selectBasStockFreezeRecordList(basStockFreezeRecord);
ExcelUtil<BasStockFreezeRecord> util = new ExcelUtil<BasStockFreezeRecord>(BasStockFreezeRecord.class);
util.exportExcel(response, list, "库存冻结记录数据");
}
/**
* 获取库存冻结记录详细信息
*/
@PreAuthorize("@ss.hasPermi('stock:freeze:query')")
@GetMapping(value = "/{whGuid}")
public AjaxResult getInfo(@PathVariable("whGuid") String whGuid)
{
return success(basStockFreezeRecordService.selectBasStockFreezeRecordByWhGuid(whGuid));
}
/**
* 新增库存冻结记录
*/
@PreAuthorize("@ss.hasPermi('stock:freeze:add')")
@Log(title = "库存冻结记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasStockFreezeRecord basStockFreezeRecord)
{
return toAjax(basStockFreezeRecordService.insertBasStockFreezeRecord(basStockFreezeRecord));
}
/**
* 修改库存冻结记录
*/
@PreAuthorize("@ss.hasPermi('stock:freeze:edit')")
@Log(title = "库存冻结记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasStockFreezeRecord basStockFreezeRecord)
{
return toAjax(basStockFreezeRecordService.updateBasStockFreezeRecord(basStockFreezeRecord));
}
/**
* 删除库存冻结记录
*/
@PreAuthorize("@ss.hasPermi('stock:freeze:remove')")
@Log(title = "库存冻结记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{whGuids}")
public AjaxResult remove(@PathVariable String[] whGuids)
{
return toAjax(basStockFreezeRecordService.deleteBasStockFreezeRecordByWhGuids(whGuids));
}
}

View File

@@ -0,0 +1,314 @@
package com.ruoyi.stock.freeze.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 库存冻结记录对象 bas_stock_freeze_record
*
* @author ruoyi
* @date 2025-05-28
*/
public class BasStockFreezeRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** guid */
private String whGuid;
/** 库存编码 */
// @Excel(name = "${stock.Freeze.stockId}")
private String stockId;
/** 货位编码 */
@Excel(name = "${stock.Freeze.cargoSpaceId}")
private String cargoSpaceId;
/** 货位名称 */
@Excel(name = "${stock.Freeze.cargoSpaceName}")
private String cargoSpaceName;
/** 托盘条码 */
@Excel(name = "${stock.Freeze.trayCode}")
private String trayCode;
/** 物品编码 */
// @Excel(name = "${stock.Freeze.productId}")
private String productId;
/** 物品名称 */
// @Excel(name = "${stock.Freeze.productName}")
private String productName;
/** 生产日期 */
// @Excel(name = "${stock.Freeze.printDate}")
private String printDate;
/** 批号 */
// @Excel(name = "${stock.Freeze.lotNo}")
private String lotNo;
/** 初始状态 */
@Excel(name = "${stock.Freeze.oldStatus}",dictType="stock_status")
private String oldStatus;
/** 更改状态 */
@Excel(name = "${stock.Freeze.currStatus}",dictType="stock_status")
private String currStatus;
/** 操作 */
// @Excel(name = "${stock.Freeze.method}")
private String method;
/** 仓库 */
@Excel(name = "${stock.Freeze.warehouseId}")
private String warehouseName;
private String warehouseId;
/** 库存字表id */
// @Excel(name = "${stock.Freeze.stockDetailId}")
private String stockDetailId;
/** 操作目标 */
// @Excel(name = "${stock.Freeze.operatingTarget}")
private String operatingTarget;
/** 条码数量(旧) */
// @Excel(name = "${stock.Freeze.barCodeOldQuantity}")
private String barCodeOldQuantity;
/** 条码数量(新) */
// @Excel(name = "${stock.Freeze.barCodeQuantity}")
private String barCodeQuantity;
/** 物料guid */
// @Excel(name = "${stock.Freeze.productGuid}")
private String productGuid;
// 创建时间
@Excel(name = "${stock.Maintain.createTime}", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30)
private Date createTime;
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getCargoSpaceName() {
return cargoSpaceName;
}
public void setCargoSpaceName(String cargoSpaceName) {
this.cargoSpaceName = cargoSpaceName;
}
public void setWhGuid(String whGuid)
{
this.whGuid = whGuid;
}
public String getWhGuid()
{
return whGuid;
}
public void setStockId(String stockId)
{
this.stockId = stockId;
}
public String getStockId()
{
return stockId;
}
public void setCargoSpaceId(String cargoSpaceId)
{
this.cargoSpaceId = cargoSpaceId;
}
public String getCargoSpaceId()
{
return cargoSpaceId;
}
public void setTrayCode(String trayCode)
{
this.trayCode = trayCode;
}
public String getTrayCode()
{
return trayCode;
}
public void setProductId(String productId)
{
this.productId = productId;
}
public String getProductId()
{
return productId;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setPrintDate(String printDate)
{
this.printDate = printDate;
}
public String getPrintDate()
{
return printDate;
}
public void setLotNo(String lotNo)
{
this.lotNo = lotNo;
}
public String getLotNo()
{
return lotNo;
}
public void setOldStatus(String oldStatus)
{
this.oldStatus = oldStatus;
}
public String getOldStatus()
{
return oldStatus;
}
public void setCurrStatus(String currStatus)
{
this.currStatus = currStatus;
}
public String getCurrStatus()
{
return currStatus;
}
public void setMethod(String method)
{
this.method = method;
}
public String getMethod()
{
return method;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setStockDetailId(String stockDetailId)
{
this.stockDetailId = stockDetailId;
}
public String getStockDetailId()
{
return stockDetailId;
}
public void setOperatingTarget(String operatingTarget)
{
this.operatingTarget = operatingTarget;
}
public String getOperatingTarget()
{
return operatingTarget;
}
public void setBarCodeOldQuantity(String barCodeOldQuantity)
{
this.barCodeOldQuantity = barCodeOldQuantity;
}
public String getBarCodeOldQuantity()
{
return barCodeOldQuantity;
}
public void setBarCodeQuantity(String barCodeQuantity)
{
this.barCodeQuantity = barCodeQuantity;
}
public String getBarCodeQuantity()
{
return barCodeQuantity;
}
public void setProductGuid(String productGuid)
{
this.productGuid = productGuid;
}
public String getProductGuid()
{
return productGuid;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("whGuid", getWhGuid())
.append("stockId", getStockId())
.append("cargoSpaceId", getCargoSpaceId())
.append("trayCode", getTrayCode())
.append("productId", getProductId())
.append("productName", getProductName())
.append("printDate", getPrintDate())
.append("lotNo", getLotNo())
.append("oldStatus", getOldStatus())
.append("currStatus", getCurrStatus())
.append("method", getMethod())
.append("warehouseId", getWarehouseId())
.append("createTime", getCreateTime())
.append("stockDetailId", getStockDetailId())
.append("operatingTarget", getOperatingTarget())
.append("barCodeOldQuantity", getBarCodeOldQuantity())
.append("barCodeQuantity", getBarCodeQuantity())
.append("productGuid", getProductGuid())
.toString();
}
}

View File

@@ -0,0 +1,62 @@
package com.ruoyi.stock.freeze.mapper;
import com.ruoyi.stock.freeze.domain.BasStockFreezeRecord;
import java.util.List;
/**
* 库存冻结记录Mapper接口
*
* @author ruoyi
* @date 2025-05-28
*/
public interface BasStockFreezeRecordMapper
{
/**
* 查询库存冻结记录
*
* @param whGuid 库存冻结记录主键
* @return 库存冻结记录
*/
public BasStockFreezeRecord selectBasStockFreezeRecordByWhGuid(String whGuid);
/**
* 查询库存冻结记录列表
*
* @param basStockFreezeRecord 库存冻结记录
* @return 库存冻结记录集合
*/
public List<BasStockFreezeRecord> selectBasStockFreezeRecordList(BasStockFreezeRecord basStockFreezeRecord);
/**
* 新增库存冻结记录
*
* @param basStockFreezeRecord 库存冻结记录
* @return 结果
*/
public int insertBasStockFreezeRecord(BasStockFreezeRecord basStockFreezeRecord);
/**
* 修改库存冻结记录
*
* @param basStockFreezeRecord 库存冻结记录
* @return 结果
*/
public int updateBasStockFreezeRecord(BasStockFreezeRecord basStockFreezeRecord);
/**
* 删除库存冻结记录
*
* @param whGuid 库存冻结记录主键
* @return 结果
*/
public int deleteBasStockFreezeRecordByWhGuid(String whGuid);
/**
* 批量删除库存冻结记录
*
* @param whGuids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBasStockFreezeRecordByWhGuids(String[] whGuids);
}

View File

@@ -0,0 +1,62 @@
package com.ruoyi.stock.freeze.service;
import com.ruoyi.stock.freeze.domain.BasStockFreezeRecord;
import java.util.List;
/**
* 库存冻结记录Service接口
*
* @author ruoyi
* @date 2025-05-28
*/
public interface IBasStockFreezeRecordService
{
/**
* 查询库存冻结记录
*
* @param whGuid 库存冻结记录主键
* @return 库存冻结记录
*/
public BasStockFreezeRecord selectBasStockFreezeRecordByWhGuid(String whGuid);
/**
* 查询库存冻结记录列表
*
* @param basStockFreezeRecord 库存冻结记录
* @return 库存冻结记录集合
*/
public List<BasStockFreezeRecord> selectBasStockFreezeRecordList(BasStockFreezeRecord basStockFreezeRecord);
/**
* 新增库存冻结记录
*
* @param basStockFreezeRecord 库存冻结记录
* @return 结果
*/
public int insertBasStockFreezeRecord(BasStockFreezeRecord basStockFreezeRecord);
/**
* 修改库存冻结记录
*
* @param basStockFreezeRecord 库存冻结记录
* @return 结果
*/
public int updateBasStockFreezeRecord(BasStockFreezeRecord basStockFreezeRecord);
/**
* 批量删除库存冻结记录
*
* @param whGuids 需要删除的库存冻结记录主键集合
* @return 结果
*/
public int deleteBasStockFreezeRecordByWhGuids(String[] whGuids);
/**
* 删除库存冻结记录信息
*
* @param whGuid 库存冻结记录主键
* @return 结果
*/
public int deleteBasStockFreezeRecordByWhGuid(String whGuid);
}

View File

@@ -0,0 +1,100 @@
package com.ruoyi.stock.freeze.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.stock.freeze.domain.BasStockFreezeRecord;
import com.ruoyi.stock.freeze.mapper.BasStockFreezeRecordMapper;
import com.ruoyi.stock.freeze.service.IBasStockFreezeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 库存冻结记录Service业务层处理
*
* @author ruoyi
* @date 2025-05-28
*/
@Service
public class BasStockFreezeRecordServiceImpl implements IBasStockFreezeRecordService
{
@Autowired
private BasStockFreezeRecordMapper basStockFreezeRecordMapper;
/**
* 查询库存冻结记录
*
* @param whGuid 库存冻结记录主键
* @return 库存冻结记录
*/
@Override
public BasStockFreezeRecord selectBasStockFreezeRecordByWhGuid(String whGuid)
{
return basStockFreezeRecordMapper.selectBasStockFreezeRecordByWhGuid(whGuid);
}
/**
* 查询库存冻结记录列表
*
* @param basStockFreezeRecord 库存冻结记录
* @return 库存冻结记录
*/
@Override
@DataScope(warehouseAlias = "bw")
public List<BasStockFreezeRecord> selectBasStockFreezeRecordList(BasStockFreezeRecord basStockFreezeRecord)
{
return basStockFreezeRecordMapper.selectBasStockFreezeRecordList(basStockFreezeRecord);
}
/**
* 新增库存冻结记录
*
* @param basStockFreezeRecord 库存冻结记录
* @return 结果
*/
@Override
public int insertBasStockFreezeRecord(BasStockFreezeRecord basStockFreezeRecord)
{
basStockFreezeRecord.setCreateTime(DateUtils.getNowDate());
basStockFreezeRecord.setWhGuid(IdUtil.fastSimpleUUID());
return basStockFreezeRecordMapper.insertBasStockFreezeRecord(basStockFreezeRecord);
}
/**
* 修改库存冻结记录
*
* @param basStockFreezeRecord 库存冻结记录
* @return 结果
*/
@Override
public int updateBasStockFreezeRecord(BasStockFreezeRecord basStockFreezeRecord)
{
return basStockFreezeRecordMapper.updateBasStockFreezeRecord(basStockFreezeRecord);
}
/**
* 批量删除库存冻结记录
*
* @param whGuids 需要删除的库存冻结记录主键
* @return 结果
*/
@Override
public int deleteBasStockFreezeRecordByWhGuids(String[] whGuids)
{
return basStockFreezeRecordMapper.deleteBasStockFreezeRecordByWhGuids(whGuids);
}
/**
* 删除库存冻结记录信息
*
* @param whGuid 库存冻结记录主键
* @return 结果
*/
@Override
public int deleteBasStockFreezeRecordByWhGuid(String whGuid)
{
return basStockFreezeRecordMapper.deleteBasStockFreezeRecordByWhGuid(whGuid);
}
}

View File

@@ -0,0 +1,98 @@
package com.ruoyi.stock.maintain.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 库存操作记录Controller
*
* @author ruoyi
* @date 2025-05-26
*/
@RestController
@RequestMapping("/stock/record")
public class BasStockMaintainRecordController extends BaseController
{
@Autowired
private IBasStockMaintainRecordService basStockMaintainRecordService;
/**
* 查询库存操作记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:record:list')")
@GetMapping("/list")
public TableDataInfo list(BasStockMaintainRecord basStockMaintainRecord)
{
startPage();
List<BasStockMaintainRecord> list = basStockMaintainRecordService.selectBasStockMaintainRecordList(basStockMaintainRecord);
return getDataTable(list);
}
/**
* 导出库存操作记录列表
*/
@PreAuthorize("@ss.hasPermi('stock:record:export')")
@Log(title = "库存操作记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasStockMaintainRecord basStockMaintainRecord)
{
List<BasStockMaintainRecord> list = basStockMaintainRecordService.selectBasStockMaintainRecordList(basStockMaintainRecord);
ExcelUtil<BasStockMaintainRecord> util = new ExcelUtil<BasStockMaintainRecord>(BasStockMaintainRecord.class);
util.exportExcel(response, list, "库存操作记录数据");
}
/**
* 获取库存操作记录详细信息
*/
@PreAuthorize("@ss.hasPermi('stock:record:query')")
@GetMapping(value = "/{whGuid}")
public AjaxResult getInfo(@PathVariable("whGuid") String whGuid)
{
return success(basStockMaintainRecordService.selectBasStockMaintainRecordByWhGuid(whGuid));
}
/**
* 新增库存操作记录
*/
@PreAuthorize("@ss.hasPermi('stock:record:add')")
@Log(title = "库存操作记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasStockMaintainRecord basStockMaintainRecord)
{
return toAjax(basStockMaintainRecordService.insertBasStockMaintainRecord(basStockMaintainRecord));
}
/**
* 修改库存操作记录
*/
@PreAuthorize("@ss.hasPermi('stock:record:edit')")
@Log(title = "库存操作记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasStockMaintainRecord basStockMaintainRecord)
{
return toAjax(basStockMaintainRecordService.updateBasStockMaintainRecord(basStockMaintainRecord));
}
/**
* 删除库存操作记录
*/
@PreAuthorize("@ss.hasPermi('stock:record:remove')")
@Log(title = "库存操作记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{whGuids}")
public AjaxResult remove(@PathVariable String[] whGuids)
{
return toAjax(basStockMaintainRecordService.deleteBasStockMaintainRecordByWhGuids(whGuids));
}
}

View File

@@ -0,0 +1,314 @@
package com.ruoyi.stock.maintain.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 库存操作记录对象 bas_stock_maintain_record
*
* @author ruoyi
* @date 2025-05-26
*/
public class BasStockMaintainRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** guid */
private String whGuid;
/** 库存编码 */
@Excel(name = "${stock.Maintain.stockId}")
private String stockId;
/** 货位编码 */
@Excel(name = "${stock.Maintain.cargoSpaceId}")
private String cargoSpaceId;
/** 货位名称 */
@Excel(name = "${stock.Maintain.cargoSpaceName}")
private String cargoSpaceName;
/** 托盘条码 */
@Excel(name = "${stock.Maintain.trayCode}")
private String trayCode;
/** 物品编码 */
@Excel(name = "${stock.Maintain.productId}")
private String productId;
/** 物品名称 */
@Excel(name = "${stock.Maintain.productName}")
private String productName;
/** 生产日期 */
// @Excel(name = "${stock.Maintain.printDate}")
private String printDate;
/** 批号 */
// @Excel(name = "${stock.Maintain.lotNo}")
private String lotNo;
/** 初始数量 */
@Excel(name = "${stock.Maintain.oldQuantity}")
private String oldQuantity;
/** 操作后数量 */
@Excel(name = "${stock.Maintain.quantity}")
private String quantity;
/** 操作 */
@Excel(name = "${stock.Maintain.method}", dictType="stock_maintain_method")
private String method;
/** 仓库 */
@Excel(name = "${stock.Maintain.warehouseId}")
private String warehouseName;
private String warehouseId;
@Excel(name = "${stock.Maintain.createTime}", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30)
private Date createTime;
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/** 库存字表id */
// @Excel(name = "${stock.Maintain.stockDetailId}")
private String stockDetailId;
/** 操作目标 */
// @Excel(name = "${stock.Maintain.operatingTarget}")
private String operatingTarget;
/** 条码数量(旧) */
// @Excel(name = "${stock.Maintain.barCodeOldQuantity}")
private String barCodeOldQuantity;
/** 条码数量(新) */
// @Excel(name = "${stock.Maintain.barCodeQuantity}")
private String barCodeQuantity;
/** 物料guid */
// @Excel(name = "${stock.Maintain.productGuid}")
private String productGuid;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getCargoSpaceName() {
return cargoSpaceName;
}
public void setCargoSpaceName(String cargoSpaceName) {
this.cargoSpaceName = cargoSpaceName;
}
public void setWhGuid(String whGuid)
{
this.whGuid = whGuid;
}
public String getWhGuid()
{
return whGuid;
}
public void setStockId(String stockId)
{
this.stockId = stockId;
}
public String getStockId()
{
return stockId;
}
public void setCargoSpaceId(String cargoSpaceId)
{
this.cargoSpaceId = cargoSpaceId;
}
public String getCargoSpaceId()
{
return cargoSpaceId;
}
public void setTrayCode(String trayCode)
{
this.trayCode = trayCode;
}
public String getTrayCode()
{
return trayCode;
}
public void setProductId(String productId)
{
this.productId = productId;
}
public String getProductId()
{
return productId;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setPrintDate(String printDate)
{
this.printDate = printDate;
}
public String getPrintDate()
{
return printDate;
}
public void setLotNo(String lotNo)
{
this.lotNo = lotNo;
}
public String getLotNo()
{
return lotNo;
}
public void setOldQuantity(String oldQuantity)
{
this.oldQuantity = oldQuantity;
}
public String getOldQuantity()
{
return oldQuantity;
}
public void setQuantity(String quantity)
{
this.quantity = quantity;
}
public String getQuantity()
{
return quantity;
}
public void setMethod(String method)
{
this.method = method;
}
public String getMethod()
{
return method;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setStockDetailId(String stockDetailId)
{
this.stockDetailId = stockDetailId;
}
public String getStockDetailId()
{
return stockDetailId;
}
public void setOperatingTarget(String operatingTarget)
{
this.operatingTarget = operatingTarget;
}
public String getOperatingTarget()
{
return operatingTarget;
}
public void setBarCodeOldQuantity(String barCodeOldQuantity)
{
this.barCodeOldQuantity = barCodeOldQuantity;
}
public String getBarCodeOldQuantity()
{
return barCodeOldQuantity;
}
public void setBarCodeQuantity(String barCodeQuantity)
{
this.barCodeQuantity = barCodeQuantity;
}
public String getBarCodeQuantity()
{
return barCodeQuantity;
}
public void setProductGuid(String productGuid)
{
this.productGuid = productGuid;
}
public String getProductGuid()
{
return productGuid;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("whGuid", getWhGuid())
.append("stockId", getStockId())
.append("cargoSpaceId", getCargoSpaceId())
.append("trayCode", getTrayCode())
.append("productId", getProductId())
.append("productName", getProductName())
.append("printDate", getPrintDate())
.append("lotNo", getLotNo())
.append("oldQuantity", getOldQuantity())
.append("quantity", getQuantity())
.append("method", getMethod())
.append("warehouseId", getWarehouseId())
.append("createTime", getCreateTime())
.append("stockDetailId", getStockDetailId())
.append("operatingTarget", getOperatingTarget())
.append("barCodeOldQuantity", getBarCodeOldQuantity())
.append("barCodeQuantity", getBarCodeQuantity())
.append("productGuid", getProductGuid())
.toString();
}
}

View File

@@ -0,0 +1,62 @@
package com.ruoyi.stock.maintain.mapper;
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
import java.util.List;
/**
* 库存操作记录Mapper接口
*
* @author ruoyi
* @date 2025-05-26
*/
public interface BasStockMaintainRecordMapper
{
/**
* 查询库存操作记录
*
* @param whGuid 库存操作记录主键
* @return 库存操作记录
*/
public BasStockMaintainRecord selectBasStockMaintainRecordByWhGuid(String whGuid);
/**
* 查询库存操作记录列表
*
* @param basStockMaintainRecord 库存操作记录
* @return 库存操作记录集合
*/
public List<BasStockMaintainRecord> selectBasStockMaintainRecordList(BasStockMaintainRecord basStockMaintainRecord);
/**
* 新增库存操作记录
*
* @param basStockMaintainRecord 库存操作记录
* @return 结果
*/
public int insertBasStockMaintainRecord(BasStockMaintainRecord basStockMaintainRecord);
/**
* 修改库存操作记录
*
* @param basStockMaintainRecord 库存操作记录
* @return 结果
*/
public int updateBasStockMaintainRecord(BasStockMaintainRecord basStockMaintainRecord);
/**
* 删除库存操作记录
*
* @param whGuid 库存操作记录主键
* @return 结果
*/
public int deleteBasStockMaintainRecordByWhGuid(String whGuid);
/**
* 批量删除库存操作记录
*
* @param whGuids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBasStockMaintainRecordByWhGuids(String[] whGuids);
}

View File

@@ -0,0 +1,62 @@
package com.ruoyi.stock.maintain.service;
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
import java.util.List;
/**
* 库存操作记录Service接口
*
* @author ruoyi
* @date 2025-05-26
*/
public interface IBasStockMaintainRecordService
{
/**
* 查询库存操作记录
*
* @param whGuid 库存操作记录主键
* @return 库存操作记录
*/
public BasStockMaintainRecord selectBasStockMaintainRecordByWhGuid(String whGuid);
/**
* 查询库存操作记录列表
*
* @param basStockMaintainRecord 库存操作记录
* @return 库存操作记录集合
*/
public List<BasStockMaintainRecord> selectBasStockMaintainRecordList(BasStockMaintainRecord basStockMaintainRecord);
/**
* 新增库存操作记录
*
* @param basStockMaintainRecord 库存操作记录
* @return 结果
*/
public int insertBasStockMaintainRecord(BasStockMaintainRecord basStockMaintainRecord);
/**
* 修改库存操作记录
*
* @param basStockMaintainRecord 库存操作记录
* @return 结果
*/
public int updateBasStockMaintainRecord(BasStockMaintainRecord basStockMaintainRecord);
/**
* 批量删除库存操作记录
*
* @param whGuids 需要删除的库存操作记录主键集合
* @return 结果
*/
public int deleteBasStockMaintainRecordByWhGuids(String[] whGuids);
/**
* 删除库存操作记录信息
*
* @param whGuid 库存操作记录主键
* @return 结果
*/
public int deleteBasStockMaintainRecordByWhGuid(String whGuid);
}

View File

@@ -0,0 +1,98 @@
package com.ruoyi.stock.maintain.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
import com.ruoyi.stock.maintain.mapper.BasStockMaintainRecordMapper;
import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 库存操作记录Service业务层处理
*
* @author ruoyi
* @date 2025-05-26
*/
@Service
public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecordService
{
@Autowired
private BasStockMaintainRecordMapper basStockMaintainRecordMapper;
/**
* 查询库存操作记录
*
* @param whGuid 库存操作记录主键
* @return 库存操作记录
*/
@Override
public BasStockMaintainRecord selectBasStockMaintainRecordByWhGuid(String whGuid)
{
return basStockMaintainRecordMapper.selectBasStockMaintainRecordByWhGuid(whGuid);
}
/**
* 查询库存操作记录列表
*
* @param basStockMaintainRecord 库存操作记录
* @return 库存操作记录
*/
@Override
@DataScope(warehouseAlias = "bw")
public List<BasStockMaintainRecord> selectBasStockMaintainRecordList(BasStockMaintainRecord basStockMaintainRecord)
{
return basStockMaintainRecordMapper.selectBasStockMaintainRecordList(basStockMaintainRecord);
}
/**
* 新增库存操作记录
*
* @param basStockMaintainRecord 库存操作记录
* @return 结果
*/
@Override
public int insertBasStockMaintainRecord(BasStockMaintainRecord basStockMaintainRecord)
{
basStockMaintainRecord.setCreateTime(DateUtils.getNowDate());
return basStockMaintainRecordMapper.insertBasStockMaintainRecord(basStockMaintainRecord);
}
/**
* 修改库存操作记录
*
* @param basStockMaintainRecord 库存操作记录
* @return 结果
*/
@Override
public int updateBasStockMaintainRecord(BasStockMaintainRecord basStockMaintainRecord)
{
return basStockMaintainRecordMapper.updateBasStockMaintainRecord(basStockMaintainRecord);
}
/**
* 批量删除库存操作记录
*
* @param whGuids 需要删除的库存操作记录主键
* @return 结果
*/
@Override
public int deleteBasStockMaintainRecordByWhGuids(String[] whGuids)
{
return basStockMaintainRecordMapper.deleteBasStockMaintainRecordByWhGuids(whGuids);
}
/**
* 删除库存操作记录信息
*
* @param whGuid 库存操作记录主键
* @return 结果
*/
@Override
public int deleteBasStockMaintainRecordByWhGuid(String whGuid)
{
return basStockMaintainRecordMapper.deleteBasStockMaintainRecordByWhGuid(whGuid);
}
}

View File

@@ -0,0 +1,22 @@
# 库存管理系统目录说明
## 目录用途
存放库存管理系统相关的业务代码和配置文件
## 主要功能
- 库存查询和统计
- 库存调整和盘点
- 库存预警管理
- 库存移动追踪
- 库存报表生成
- 库存分析和预测
## 目录结构
```
stock/
├── config/ # 库存系统配置文件
├── controller/ # 库存控制器
├── model/ # 库存数据模型
├── service/ # 库存业务逻辑
└── utils/ # 库存相关工具类
```

View File

@@ -0,0 +1,108 @@
package com.ruoyi.stock.stock.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.stock.stock.domain.BasStock;
import com.ruoyi.stock.stock.service.IBasStockService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 库存信息Controller
*
* @author ruoyi
* @date 2025-05-24
*/
@RestController
@RequestMapping("/stock/management")
public class BasStockController extends BaseController
{
@Autowired
private IBasStockService basStockService;
/**
* 查询库存信息列表
*/
@PreAuthorize("@ss.hasPermi('stock:management:list')")
@GetMapping("/list")
public TableDataInfo list(BasStock basStock)
{
startPage();
List<BasStock> list = basStockService.selectBasStockList(basStock);
return getDataTable(list);
}
/**
* 导出库存信息列表
*/
@PreAuthorize("@ss.hasPermi('stock:management:export')")
@Log(title = "库存信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasStock basStock)
{
List<BasStock> list = basStockService.selectBasStockList(basStock);
ExcelUtil<BasStock> util = new ExcelUtil<BasStock>(BasStock.class);
util.exportExcel(response, list, "库存信息数据");
}
/**
* 获取库存信息详细信息
*/
@PreAuthorize("@ss.hasPermi('stock:management:query')")
@GetMapping(value = "/{stockId}")
public AjaxResult getInfo(@PathVariable("stockId") String stockId)
{
return success(basStockService.selectBasStockByStockId(stockId));
}
/**
* 新增库存信息
*/
@PreAuthorize("@ss.hasPermi('stock:management:add')")
@Log(title = "库存信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasStock basStock)
{
return toAjax(basStockService.insertBasStock(basStock));
}
/**
* 修改库存信息
*/
@PreAuthorize("@ss.hasPermi('stock:management:edit')")
@Log(title = "库存信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasStock basStock)
{
return toAjax(basStockService.updateBasStock(basStock));
}
/**
* 删除库存信息
*/
@PreAuthorize("@ss.hasPermi('stock:management:remove')")
@Log(title = "库存信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockIds}")
public AjaxResult remove(@PathVariable String[] stockIds)
{
return toAjax(basStockService.deleteBasStockByStockIds(stockIds));
}
/**
* 重置盘点记录
*/
@PreAuthorize("@ss.hasPermi('stock:management:resetPdRecord')")
@Log(title = "重置盘点记录", businessType = BusinessType.DELETE)
@GetMapping("/resetPdRecord")
public AjaxResult resetPdRecord(){
return basStockService.resetPdRecord();
}
}

View File

@@ -0,0 +1,187 @@
package com.ruoyi.stock.stock.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.domain.ExtraField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.ai.tool.annotation.ToolParam;
import java.util.List;
/**
* 库存信息对象 bas_stock
*
* @author ruoyi
* @date 2025-05-24
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class BasStock extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 库存id */
@Excel(name = "${stock.BasStock.stockId}")
private String stockId;
/** 货位id */
@Excel(name = "${stock.BasStock.cargoSpaceId}")
private String cargoSpaceId;
/** 货位名称 */
@Excel(name = "${stock.BasStock.cargoSpaceName}")
private String cargoSpaceName;
/** 库存状态 */
@Excel(name = "${stock.BasStock.stockStatus}", dictType = "stock_status")
private String stockStatus;
//货位库存状态
@Excel(name = "${stock.BasStock.cargoSpaceStockStatus}", dictType = "cargo_space_status")
private String cargoSpaceStockStatus;
//货位是否锁定
@Excel(name = "${stock.BasStock.cargoSpaceStatus}", dictType = "cargo_space_lock_status")
private String cargoSpaceStatus;
/** 物料状态 */
@Excel(name = "${stock.BasStock.productStatus}", dictType = "product_status")
private String productStatus;
//额外字段
@Excels({
@Excel(name = "${stock.BasStock.productId}", targetAttr = "productId"),// 品号
@Excel(name = "${stock.BasStock.materialDesc}", targetAttr = "materialDesc"),// 品名
@Excel(name = "${stock.BasStock.englishDesc}", targetAttr = "englishDesc"),//物料英文描述
@Excel(name = "${stock.BasStock.netWeight}", targetAttr = "netWeight"),//净重
@Excel(name = "${stock.BasStock.length}",targetAttr = "length"),//长度
@Excel(name = "${stock.BasStock.width}",targetAttr = "width"),//宽度
@Excel(name = "${stock.BasStock.height}",targetAttr = "height"),//高度
@Excel(name = "${stock.BasStock.volume}",targetAttr = "volume")//体积
})
private ExtraField extraField;
/** 品号 */
// @Excel(name = "${stock.BasStock.productId}")
private String productId;
//品名
// @Excel(name = "${stock.BasStock.materialDesc}")
private String materialDesc;
//物料英文描述
// @Excel(name = "${stock.BasStock.englishDesc}")
private String spare1;
//净重
// @Excel(name = "${stock.BasStock.netWeight}")
private String spare2;
//长度
// @Excel(name = "${stock.BasStock.length}")
private String spare5;
//宽度
// @Excel(name = "${stock.BasStock.width}")
private String spare6;
//高度
// @Excel(name = "${stock.BasStock.height}")
private String spare7;
//体积
// @Excel(name = "${stock.BasStock.volume}")
private String spare8;
private String voltage;
private String power;
private String phase;
private String netWeight;
private String grossWeight;
private String distribution;
private String model;
private String orderId;
/** 库存数量 */
@Excel(name = "${stock.BasStock.quantity}")
private String quantity;
/** 作业ID */
@Excel(name = "${stock.BasStock.jobId}")
private String jobId;
/** 托盘条码 */
@Excel(name = "${stock.BasStock.trayCode}")
private String trayCode;
/** 入库主单 */
@Excel(name = "${stock.BasStock.stockinId}")
private String stockinId;
/** 入库子单id */
@Excel(name = "${stock.BasStock.stockinDetailId}")
private String stockinDetailId;
/** 入库类型 */
@Excel(name = "${stock.BasStock.inType}")
private String inType;
/** 仓库名称 */
@Excel(name = "${stock.BasStock.warehouseName}")
private String warehouseName;
/** 入库时间 */
@Excel(name = "${stock.BasStock.inDate}")
private String inDate;
/** 批次号 */
// @Excel(name = "${stock.BasStock.lotNo}")
private String lotNo;
/** 回流时间 */
// @Excel(name = "${stock.BasStock.backDate}")
private String backDate;
/** 物料GUID */
// @Excel(name = "${stock.BasStock.productGuid}")
private String productGuid;
/** 出库数量 */
// @Excel(name = "${stock.BasStock.outQuantity}")
private String outQuantity;
/** 入库班组ID */
// @Excel(name = "${stock.BasStock.inClassId}")
private String inClassId;
/** 仓库 */
// @Excel(name = "${stock.BasStock.warehouseId}")
private String warehouseId;
/** 垛型ID */
// @Excel(name = "${stock.BasStock.stackingId}")
private String stackingId;
/** 备用字段3 */
// @Excel(name = "${stock.BasStock.spare3}")
private String spare3;
/** 备用字段4 */
// @Excel(name = "${stock.BasStock.spare4}")
private String spare4;
//品名
// @Excel(name = "品名")
private String productName;
private List<String> typeData;
}

View File

@@ -0,0 +1,73 @@
package com.ruoyi.stock.stock.mapper;
import com.ruoyi.stock.stock.domain.BasStock;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 库存信息Mapper接口
*
* @author ruoyi
* @date 2025-05-24
*/
public interface BasStockMapper
{
/**
* 查询库存信息
*
* @param stockId 库存信息主键
* @return 库存信息
*/
public BasStock selectBasStockByStockId(String stockId);
/**
* 查询库存信息列表
*
* @param basStock 库存信息
* @return 库存信息集合
*/
public List<BasStock> selectBasStockList(BasStock basStock);
/**
* 新增库存信息
*
* @param basStock 库存信息
* @return 结果
*/
public int insertBasStock(BasStock basStock);
/**
* 修改库存信息
*
* @param basStock 库存信息
* @return 结果
*/
public int updateBasStock(BasStock basStock);
/**
* 删除库存信息
*
* @param stockId 库存信息主键
* @return 结果
*/
public int deleteBasStockByStockId(String stockId);
/**
* 批量删除库存信息
*
* @param stockIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteBasStockByStockIds(String[] stockIds);
void insertBasStockList(List<BasStock> list);
List<BasStock> selectKtpStock(BasStock basStock);
int updateStockStatusByTrayCode(@Param("stockStatus") String stockStatus,@Param("trayCode") String trayCode);
void resetPdRecord();
List<BasStock> getStockBySerial(String trayCode);
}

View File

@@ -0,0 +1,86 @@
package com.ruoyi.stock.stock.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.stock.stock.domain.BasStock;
import java.util.List;
/**
* 库存信息Service接口
*
* @author ruoyi
* @date 2025-05-24
*/
public interface IBasStockService
{
/**
* 查询库存信息
*
* @param stockId 库存信息主键
* @return 库存信息
*/
public BasStock selectBasStockByStockId(String stockId);
/**
* 查询库存信息列表
*
* @param basStock 库存信息
* @return 库存信息集合
*/
public List<BasStock> selectBasStockList(BasStock basStock);
/**
* 无权限查询库存信息列表
*
* @param basStock 库存信息
* @return 库存信息集合
*/
public List<BasStock> selectBasStockListApi(BasStock basStock);
/**
* 新增库存信息
*
* @param basStock 库存信息
* @return 结果
*/
public int insertBasStock(BasStock basStock);
/**
* 新增库存信息(不记录维护记录)
*
* @param basStock 库存信息
* @return 结果
*/
public int insertBasStockWithoutMaintainRecord(BasStock basStock);
/**
* 修改库存信息
*
* @param basStock 库存信息
* @return 结果
*/
public int updateBasStock(BasStock basStock);
/**
* 批量删除库存信息
*
* @param stockIds 需要删除的库存信息主键集合
* @return 结果
*/
public int deleteBasStockByStockIds(String[] stockIds);
/**
* 删除库存信息信息
*
* @param stockId 库存信息主键
* @return 结果
*/
public int deleteBasStockByStockId(String stockId);
void insertBasStockList(List<BasStock> list);
List<BasStock> selectKtpStock(BasStock basStock);
AjaxResult resetPdRecord();
List<BasStock> getStockBySerial(String serial);
}

View File

@@ -0,0 +1,208 @@
package com.ruoyi.stock.stock.service.impl;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.stock.freeze.domain.BasStockFreezeRecord;
import com.ruoyi.stock.freeze.service.IBasStockFreezeRecordService;
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService;
import com.ruoyi.stock.stock.domain.BasStock;
import com.ruoyi.stock.stock.mapper.BasStockMapper;
import com.ruoyi.stock.stock.service.IBasStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* 库存信息Service业务层处理
*
* @author ruoyi
* @date 2025-05-24
*/
@Service
public class BasStockServiceImpl implements IBasStockService
{
@Autowired
private BasStockMapper basStockMapper;
@Autowired
private IBasStockMaintainRecordService basStockMaintainRecordService;
@Autowired
private IBasStockFreezeRecordService basStockFreezeRecordService;
@Autowired
private IBasCargoSpaceService basCargoSpaceService;
/**
* 查询库存信息
*
* @param stockId 库存信息主键
* @return 库存信息
*/
@Override
public BasStock selectBasStockByStockId(String stockId)
{
return basStockMapper.selectBasStockByStockId(stockId);
}
/**
* 查询库存信息列表
*
* @param basStock 库存信息
* @return 库存信息
*/
@Override
public List<BasStock> selectBasStockList(BasStock basStock)
{
return basStockMapper.selectBasStockList(basStock);
}
/**
* 无权限查询库存信息列表
*
* @param basStock 库存信息
* @return 库存信息集合
*/
@Override
public List<BasStock> selectBasStockListApi(BasStock basStock)
{
return basStockMapper.selectBasStockList(basStock);
}
/**
* 新增库存信息
*
* @param basStock 库存信息
* @return 结果
*/
@Override
public int insertBasStock(BasStock basStock)
{
insertMaintainRecord(null,basStock,"1");
return basStockMapper.insertBasStock(basStock);
}
private void insertMaintainRecord(BasStock oldStock, BasStock basStock, String operate) {
if (oldStock != null && (!oldStock.getQuantity().equals(basStock.getQuantity())||!oldStock.getProductId().equals(basStock.getProductId()))) {
BasStockMaintainRecord basStockMaintainRecord = new BasStockMaintainRecord();
basStockMaintainRecord.setWhGuid(IdUtil.fastSimpleUUID());
basStockMaintainRecord.setStockId(basStock.getStockId());
basStockMaintainRecord.setCargoSpaceId(basStock.getCargoSpaceId());
basStockMaintainRecord.setLotNo(oldStock.getCargoSpaceId());
basStockMaintainRecord.setTrayCode(basStock.getTrayCode());
basStockMaintainRecord.setProductGuid(oldStock.getProductName());
basStockMaintainRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
basStockMaintainRecord.setCreateTime(new Date());
basStockMaintainRecord.setOldQuantity(oldStock.getQuantity());
basStockMaintainRecord.setQuantity(basStock.getQuantity());
basStockMaintainRecord.setProductId(basStock.getProductId());
basStockMaintainRecord.setProductName(basStock.getProductName());
basStockMaintainRecord.setWarehouseId(basStock.getWarehouseId());
basStockMaintainRecord.setMethod(operate);
basStockMaintainRecordService.insertBasStockMaintainRecord(basStockMaintainRecord);
}
}
/**
* 修改库存信息
*
* @param basStock 库存信息
* @return 结果
*/
@Override
public int updateBasStock(BasStock basStock)
{
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(basStock.getStockId());
insertMaintainRecord(oldBasStock,basStock,"2");
insertFreezeRecord(oldBasStock,basStock);
return basStockMapper.updateBasStock(basStock);
}
private void insertFreezeRecord(BasStock oldBasStock, BasStock basStock) {
if (!oldBasStock.getStockStatus().equals(basStock.getStockStatus())){
BasStockFreezeRecord basStockFreezeRecord = new BasStockFreezeRecord();
basStockFreezeRecord.setWhGuid(IdUtil.fastSimpleUUID());
basStockFreezeRecord.setCargoSpaceId(basStock.getCargoSpaceId());
basStockFreezeRecord.setTrayCode(basStock.getTrayCode());
basStockFreezeRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
basStockFreezeRecord.setCreateTime(new Date());
basStockFreezeRecord.setOldStatus(oldBasStock.getStockStatus());
basStockFreezeRecord.setCurrStatus(basStock.getStockStatus());
basStockFreezeRecord.setWarehouseId(basStock.getWarehouseId());
if ("1".equals(basStock.getStockStatus())){
basStockFreezeRecord.setMethod("解冻");
}else {
basStockFreezeRecord.setMethod("冻结");
}
basStockMapper.updateStockStatusByTrayCode(basStock.getStockStatus(),oldBasStock.getTrayCode());
basStockFreezeRecordService.insertBasStockFreezeRecord(basStockFreezeRecord);
}
}
/**
* 批量删除库存信息
*
* @param stockIds 需要删除的库存信息主键
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteBasStockByStockIds(String[] stockIds)
{
for (String stockId : stockIds) {
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(stockId);
insertMaintainRecord(oldBasStock,oldBasStock,"3");
}
return basStockMapper.deleteBasStockByStockIds(stockIds);
}
/**
* 删除库存信息信息
*
* @param stockId 库存信息主键
* @return 结果
*/
@Override
public int deleteBasStockByStockId(String stockId)
{
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(stockId);
insertMaintainRecord(oldBasStock,oldBasStock,"3");
return basStockMapper.deleteBasStockByStockId(stockId);
}
@Override
public void insertBasStockList(List<BasStock> list) {
basStockMapper.insertBasStockList(list);
}
@DataScope(warehouseAlias = "s")
@Override
public List<BasStock> selectKtpStock(BasStock basStock) {
return basStockMapper.selectKtpStock(basStock);
}
@Override
public AjaxResult resetPdRecord() {
basStockMapper.resetPdRecord();
return AjaxResult.success();
}
@Override
public List<BasStock> getStockBySerial(String trayCode) {
return basStockMapper.getStockBySerial(trayCode);
}
/**
* 新增库存信息(不记录维护记录)
*
* @param basStock 库存信息
* @return 结果
*/
@Override
public int insertBasStockWithoutMaintainRecord(BasStock basStock)
{
return basStockMapper.insertBasStock(basStock);
}
}