diff --git a/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/controller/BasStockMaintainRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/controller/BasStockMaintainRecordController.java new file mode 100644 index 0000000..a917fb1 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/controller/BasStockMaintainRecordController.java @@ -0,0 +1,104 @@ +package com.ruoyi.stock.maintain.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.stock.maintain.domain.BasStockMaintainRecord; +import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 库存操作记录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 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 list = basStockMaintainRecordService.selectBasStockMaintainRecordList(basStockMaintainRecord); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/domain/BasStockMaintainRecord.java b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/domain/BasStockMaintainRecord.java new file mode 100644 index 0000000..cd7999c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/domain/BasStockMaintainRecord.java @@ -0,0 +1,278 @@ +package com.ruoyi.stock.maintain.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 库存操作记录对象 bas_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 = "库存编码") + private String stockId; + + /** 货位编码 */ + @Excel(name = "货位编码") + private String cargoSpaceId; + + /** 托盘条码 */ + @Excel(name = "托盘条码") + private String trayCode; + + /** 物品编码 */ + @Excel(name = "物品编码") + private String productId; + + /** 物品名称 */ + @Excel(name = "物品名称") + private String productName; + + /** 生产日期 */ + @Excel(name = "生产日期") + private String printDate; + + /** 批号 */ + @Excel(name = "批号") + private String lotNo; + + /** 初始数量 */ + @Excel(name = "初始数量") + private String oldQuantity; + + /** 操作后数量 */ + @Excel(name = "操作后数量") + private String quantity; + + /** 操作 */ + @Excel(name = "操作") + private String method; + + /** 仓库 */ + @Excel(name = "仓库") + private String warehouseId; + + /** 库存字表id */ + @Excel(name = "库存字表id") + private String stockDetailId; + + /** 操作目标 */ + @Excel(name = "操作目标") + private String operatingTarget; + + /** 条码数量(旧) */ + @Excel(name = "条码数量", readConverterExp = "旧=") + private String barCodeOldQuantity; + + /** 条码数量(新) */ + @Excel(name = "条码数量", readConverterExp = "新=") + private String barCodeQuantity; + + /** 物料guid */ + @Excel(name = "物料guid") + private String productGuid; + + 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(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/mapper/BasStockMaintainRecordMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/mapper/BasStockMaintainRecordMapper.java new file mode 100644 index 0000000..7631790 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/mapper/BasStockMaintainRecordMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.stock.maintain.mapper; + +import java.util.List; +import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord; + +/** + * 库存操作记录Mapper接口 + * + * @author ruoyi + * @date 2025-05-26 + */ +public interface BasStockMaintainRecordMapper +{ + /** + * 查询库存操作记录 + * + * @param whGuid 库存操作记录主键 + * @return 库存操作记录 + */ + public BasStockMaintainRecord selectBasStockMaintainRecordByWhGuid(String whGuid); + + /** + * 查询库存操作记录列表 + * + * @param basStockMaintainRecord 库存操作记录 + * @return 库存操作记录集合 + */ + public List 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); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/service/IBasStockMaintainRecordService.java b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/service/IBasStockMaintainRecordService.java new file mode 100644 index 0000000..64aff65 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/service/IBasStockMaintainRecordService.java @@ -0,0 +1,61 @@ +package com.ruoyi.stock.maintain.service; + +import java.util.List; +import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord; + +/** + * 库存操作记录Service接口 + * + * @author ruoyi + * @date 2025-05-26 + */ +public interface IBasStockMaintainRecordService +{ + /** + * 查询库存操作记录 + * + * @param whGuid 库存操作记录主键 + * @return 库存操作记录 + */ + public BasStockMaintainRecord selectBasStockMaintainRecordByWhGuid(String whGuid); + + /** + * 查询库存操作记录列表 + * + * @param basStockMaintainRecord 库存操作记录 + * @return 库存操作记录集合 + */ + public List 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); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/service/impl/BasStockMaintainRecordServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/service/impl/BasStockMaintainRecordServiceImpl.java new file mode 100644 index 0000000..7695edd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/stock/maintain/service/impl/BasStockMaintainRecordServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.stock.maintain.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.stock.maintain.mapper.BasStockMaintainRecordMapper; +import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord; +import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService; + +/** + * 库存操作记录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 + public List 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); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/stock/BasStockMaintainRecordMapper.xml b/ruoyi-admin/src/main/resources/mapper/stock/BasStockMaintainRecordMapper.xml new file mode 100644 index 0000000..d7c73b9 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/stock/BasStockMaintainRecordMapper.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select wh_guid, stock_id, cargo_space_id, tray_code, product_id, product_name, print_date, lot_no, old_quantity, quantity, method, warehouse_id, create_time, stock_detail_id, operating_target, bar_code_old_quantity, bar_code_quantity, product_guid from bas_stock_maintain_record + + + + + + + + insert into bas_stock_maintain_record + + wh_guid, + stock_id, + cargo_space_id, + tray_code, + product_id, + product_name, + print_date, + lot_no, + old_quantity, + quantity, + method, + warehouse_id, + create_time, + stock_detail_id, + operating_target, + bar_code_old_quantity, + bar_code_quantity, + product_guid, + + + #{whGuid}, + #{stockId}, + #{cargoSpaceId}, + #{trayCode}, + #{productId}, + #{productName}, + #{printDate}, + #{lotNo}, + #{oldQuantity}, + #{quantity}, + #{method}, + #{warehouseId}, + #{createTime}, + #{stockDetailId}, + #{operatingTarget}, + #{barCodeOldQuantity}, + #{barCodeQuantity}, + #{productGuid}, + + + + + update bas_stock_maintain_record + + stock_id = #{stockId}, + cargo_space_id = #{cargoSpaceId}, + tray_code = #{trayCode}, + product_id = #{productId}, + product_name = #{productName}, + print_date = #{printDate}, + lot_no = #{lotNo}, + old_quantity = #{oldQuantity}, + quantity = #{quantity}, + method = #{method}, + warehouse_id = #{warehouseId}, + create_time = #{createTime}, + stock_detail_id = #{stockDetailId}, + operating_target = #{operatingTarget}, + bar_code_old_quantity = #{barCodeOldQuantity}, + bar_code_quantity = #{barCodeQuantity}, + product_guid = #{productGuid}, + + where wh_guid = #{whGuid} + + + + delete from bas_stock_maintain_record where wh_guid = #{whGuid} + + + + delete from bas_stock_maintain_record where wh_guid in + + #{whGuid} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/stock/record.js b/ruoyi-ui/src/api/stock/record.js new file mode 100644 index 0000000..ece37b0 --- /dev/null +++ b/ruoyi-ui/src/api/stock/record.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询库存操作记录列表 +export function listRecord(query) { + return request({ + url: '/stock/record/list', + method: 'get', + params: query + }) +} + +// 查询库存操作记录详细 +export function getRecord(whGuid) { + return request({ + url: '/stock/record/' + whGuid, + method: 'get' + }) +} + +// 新增库存操作记录 +export function addRecord(data) { + return request({ + url: '/stock/record', + method: 'post', + data: data + }) +} + +// 修改库存操作记录 +export function updateRecord(data) { + return request({ + url: '/stock/record', + method: 'put', + data: data + }) +} + +// 删除库存操作记录 +export function delRecord(whGuid) { + return request({ + url: '/stock/record/' + whGuid, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/stock/record/index.vue b/ruoyi-ui/src/views/stock/record/index.vue new file mode 100644 index 0000000..198a2a7 --- /dev/null +++ b/ruoyi-ui/src/views/stock/record/index.vue @@ -0,0 +1,470 @@ + + +