feat(inventory): 新增库存管理功能

- 添加产品库存新增、编辑、删除功能
- 实现入库单新增、编辑功能
- 增加仓库信息管理功能
- 添加库存数据导入导出功能
- 优化供应商管理界面,增加默认仓库选择
dev_1.0.0
chenhao 2025-08-08 09:14:21 +08:00
parent e34369e963
commit d760e5f09d
45 changed files with 3594 additions and 28 deletions

View File

@ -110,7 +110,7 @@ shiro:
# 设置Cookie的过期时间天为单位 # 设置Cookie的过期时间天为单位
maxAge: 30 maxAge: 30
# 设置密钥务必保持唯一性生成方式直接拷贝到main运行即可Base64.encodeToString(CipherUtils.generateNewKey(128, "AES").getEncoded()) 默认启动生成随机秘钥随机秘钥会导致之前客户端RememberMe Cookie无效如设置固定秘钥RememberMe Cookie则有效 # 设置密钥务必保持唯一性生成方式直接拷贝到main运行即可Base64.encodeToString(CipherUtils.generateNewKey(128, "AES").getEncoded()) 默认启动生成随机秘钥随机秘钥会导致之前客户端RememberMe Cookie无效如设置固定秘钥RememberMe Cookie则有效
cipherKey: cipherKey: p8D/J77AfqR1i4tQYorziA==
session: session:
# Session超时时间-1代表永不过期默认30分钟 # Session超时时间-1代表永不过期默认30分钟
expireTime: 120 expireTime: 120

View File

@ -27,8 +27,8 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
* *
**/ **/
Ext.PagingToolbar.prototype.firstText = "Erste Seite"; Ext.PagingToolbar.prototype.firstText = "Erste Seite";
Ext.PagingToolbar.prototype.prevText = "Vorherige Seite"; Ext.PagingToolbar.prototype.prevText = "Vorherige Seite";
Ext.PagingToolbar.prototype.nextText = "Nächste Seite"; Ext.PagingToolbar.prototype.nextText = "Nächste Seite";
Ext.PagingToolbar.prototype.lastText = "Letzte Seite"; Ext.PagingToolbar.prototype.lastText = "Letzte Seite";

View File

@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增产品库存')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-info-add">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">产品编码:</label>
<div class="col-sm-8">
<input name="productCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">产品序列号:</label>
<div class="col-sm-8">
<input name="productSn" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">入库单号:</label>
<div class="col-sm-8">
<input name="innerCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">出库单号:</label>
<div class="col-sm-8">
<input name="outerCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">所属仓库:</label>
<div class="col-sm-8">
<input name="warehouseId" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">入库价:</label>
<div class="col-sm-8">
<input name="innerPrice" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">出库价:</label>
<div class="col-sm-8">
<input name="outerPrice" class="form-control" type="text">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "inventory/info"
$("#form-info-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-info-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改产品库存')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-info-edit" th:object="${inventoryInfo}">
<input name="id" th:field="*{id}" type="hidden">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">产品编码:</label>
<div class="col-sm-8">
<input name="productCode" th:field="*{productCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">产品序列号:</label>
<div class="col-sm-8">
<input name="productSn" th:field="*{productSn}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">入库单号:</label>
<div class="col-sm-8">
<input name="innerCode" th:field="*{innerCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">出库单号:</label>
<div class="col-sm-8">
<input name="outerCode" th:field="*{outerCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">所属仓库:</label>
<div class="col-sm-8">
<input name="warehouseId" th:field="*{warehouseId}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">入库价:</label>
<div class="col-sm-8">
<input name="innerPrice" th:field="*{innerPrice}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">出库价:</label>
<div class="col-sm-8">
<input name="outerPrice" th:field="*{outerPrice}" class="form-control" type="text">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "inventory/info";
$("#form-info-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,128 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('产品库存列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>产品编码:</label>
<input type="text" name="productCode"/>
</li>
<li>
<label>产品型号:</label>
<input type="text" name="model"/>
</li>
<li>
<label>产品名称:</label>
<input type="text" name="productName"/>
</li>
<li>
<label>制造商:</label>
<input type="text" name="vendorName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="inventory:info:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="inventory:info:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="inventory:info:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="inventory:info:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('inventory:info:edit')}]];
var removeFlag = [[${@permission.hasPermi('inventory:info:remove')}]];
var prefix = ctx + "inventory/info";
$(function() {
var options = {
url: prefix + "/group/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "产品库存",
columns: [{
title: '序号',
formatter: function (value, row, index) {
return $.table.serialNumber(index);
}
},
{
field: 'id',
title: '',
visible: false
},
{
field: 'productCode',
title: '产品编码'
},
{
field: 'model',
title: '产品型号'
},
{
field: 'productName',
title: '产品名称'
},
{
field: 'availableCount',
title: '实时库存'
},
{
field: 'reservedCount',
title: '累计发货'
},
{
field: 'vendorName',
title: '制造商'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="showInnerLog(\''+row.productCode+'\')"><i class="fa fa-edit"></i>入库记录</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
function showInnerLog(productCode){
var url = prefix + "/innerLog/" + productCode;
$.modal.openFull("入库记录表", url);
}
</script>
</body>
</html>

View File

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('入库单信息列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="col-sm-12 search-collapse" style="display: none">
<form id="formId">
<div class="select-list">
<input type="hidden" name="productCode" th:value="${productCode}"/>
</div>
</form>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('inventory:inner:edit')}]];
var removeFlag = [[${@permission.hasPermi('inventory:inner:remove')}]];
var prefix = ctx + "inventory/inner";
function viewFull(id) {
var url = prefix + "/view/" + id;
$.modal.openFull("查看详情", url);
}
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
viewUrl: prefix + "/view/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "入库单信息",
columns: [
{
field: 'id',
title: '',
visible: false
},
{
field: 'innerCode',
title: '入库单号',
formatter: function (value, row, index) {
return '<a href="javascript:void(0)" onclick="viewFull(\'' + row.id + '\')">'+row.innerCode+'</a> ';
}
},
{
field: 'productCode',
title: '产品编码'
},
{
field: 'model',
title: '产品型号'
},
{
field: 'quantity',
title: '入库数量'
},
{
field: 'vendorName',
title: '制造商'
},
{
field: 'warehouseName',
title: '入库仓'
},
{
field: 'createByName',
title: '经办人'
},
{
field: 'createTime',
title: '入库时间'
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,507 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增入库单信息')"/>
</head>
<style>
#addInventory label{
padding-right: 0px;
}
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inner-add">
<div class="col-xs-12">
<h2>入库信息</h2>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-5 control-label ">入库单号:</label>
<div class="col-sm-7">
<input name="innerCode" class="form-control" type="text" readonly placeholder="保存后自动生成"/>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-5 control-label is-required">制造商:</label>
<div class="col-sm-7">
<input name="vendorCode" class="form-control" type="hidden" >
<input name="vendorName" class="form-control" type="text" readonly required placeholder="自动带入">
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-5 control-label">入库时间:</label>
<div class="col-sm-7">
<input name="quantity" class="form-control" type="text" readonly placeholder="保存后自动生成"/>
</div>
</div>
</div>
<div class="col-xs-12">
<h2 >产品信息</h2>
</div>
<div class="col-xs-12" style="display: flex;justify-content: space-between;">
<div class="btn-group-sm">
<a class="btn btn-info" onclick="downloadTem()">
下载模板
</a>
<a class="btn btn-warning" onclick="importList()">
导入模板
</a>
</div>
<div class="btn-group-sm">
<a class="btn btn-info" onclick="addInventory()">
添加
</a>
</div>
</div>
<input id="uploadInput" type="file" accept=".xls,.xlsx" style="display: none">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</form>
</div>
<div id="addInventory" style="display: none">
<div class="col-xs-12" style="margin-bottom: 20px">
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-7">
<input id="productCodeQuery" class="form-control" type="text" placeholder="输入产品编码查询"/>
</div>
<div class="col-sm-3 btn-group-sm">
<a class="btn btn-info" onclick="queryProduct()">
查询
</a>
<a class="btn btn-warning" onclick="clearAddInventory()">
重置
</a>
</div>
</div>
</div>
<form class="form-horizontal m" id="addInventoryForm">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required ">产品编码:</label>
<div class="col-sm-8">
<input id="productCode" name="productCode" class="form-control" type="text" readonly required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">产品型号:</label>
<div class="col-sm-8">
<input id="model" name="model" class="form-control" type="text" readonly required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-2 control-label is-required">产品描述:</label>
<div class="col-sm-10">
<input id="productDesc" name="productDesc" class="form-control" type="text" readonly required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">入库价(含税):</label>
<div class="col-sm-8">
<input id="innerPrice" name="innerPrice" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">数量:</label>
<div class="col-sm-8">
<input id="quantity" name="quantity" onchange="calcSn()" class="form-control" type="number" min="0" max="3000" step="1" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">入库仓:</label>
<div class="col-sm-8">
<select id="warehouseId" name="warehouseId" class="form-control" th:with="type=${warehouseList}">
<option th:each="dict : ${type}" th:text="${dict.warehouseName}"
th:value="${dict.id}" ></option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">该批次起始SN码</label>
<div class="col-sm-8">
<input id="productSn" name="productSn" onchange="calcSn()" class="form-control" type="text" required>
</div>
</div>
</div>
</form>
<div class="col-xs-12" style="text-align: center">
<label class="col-sm-4 control-label is-required">SN码范围</label>
<label class="col-sm-4 control-label" id="showAllSn"></label>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var prefix = ctx + "inventory/inner"
// 获取 ctx 的通用函数
function getCtx() {
// 尝试多种方式获取 ctx
return window.parent.ctx || window.ctx || window.top.ctx || window.parent.window.ctx || '/';
}
$("#form-inner-add").validate({
focusCleanup: true
});
function getCurrentVendor(){
$.operate.get(ctx+ "system/vendor/current",function (data) {
if (data.data){
$('[name="vendorCode"]').val(data.data.vendorCode)
$('[name="vendorName"]').val(data.data.vendorName)
}
})
}
function clearAddInventory(){
$('#productCodeQuery').val('')
$('#addInventory input[type="text"]').each(function() {
$(this).val('');
});
}
function calcSn() {
let quantity=$('#quantity').val()
if (!quantity||quantity.length<=0){
return
}
quantity=Number(quantity)
let productSn=$('#productSn').val()
if (!productSn||productSn.length<=0){
return
}
// 解析SN码分离前缀和数字部分
let snPrefix = "";
let snNumber = "";
debugger
// 从字符串末尾开始查找数字部分
for (let i = productSn.length - 1; i >= 0; i--) {
if (!isNaN(productSn[i]) && productSn[i] !== ' ') {
snNumber = productSn[i] + snNumber;
} else {
snPrefix = productSn.substring(0, i + 1);
break;
}
}
let snNumberLength = snNumber.length;
let startNumber = parseInt(snNumber);
// 计算当前SN码的数字部分
let currentNumber = startNumber + quantity-1;
// 保持原有的数字位数格式(补零)
let formattedNumber = String(currentNumber).padStart(snNumberLength, '0');
// 组合完整的SN码
let lastSn = snPrefix + formattedNumber;
$('#showAllSn').text('('+productSn+'-'+lastSn+')')
}
function queryProduct(){
let productCode = $('#productCodeQuery').val()
if (!productCode ||productCode.trim().length<=0){
$.modal.msgError("查询条件不能为空");
return
}
$.operate.get(getCtx()+"system/product/query/"+productCode,res=>{
if (res.code==0){
$('#productCode').val(res.data.productCode)
$('#model').val(res.data.model)
$('#productDesc').val(res.data.description)
}
})
}
function addInventory() {
parent.$('.layui-layer-btn').css('display', 'none')
let width=800,height=400
if ($.common.isMobile()) {
width = 'auto';
height = 'auto';
}
layer.open({
id: 'add-inventory',
type: 1,
shade: 0.5, // 不显示遮罩
area:[width + 'px', height + 'px'],
content: $('#addInventory'), // 捕获的元素
btn:['确定','关闭'],
yes: function(index, layero, that){
if ($.validate.form('addInventoryForm')) {
let data=[]
let quantity=Number($('#quantity').val())
let productSn=$('#productSn').val()
// 解析SN码分离前缀和数字部分
let snPrefix = "";
let snNumber = "";
// 从字符串末尾开始查找数字部分
for (let i = productSn.length - 1; i >= 0; i--) {
if (!isNaN(productSn[i]) && productSn[i] !== ' ') {
snNumber = productSn[i] + snNumber;
} else {
snPrefix = productSn.substring(0, i + 1);
break;
}
}
let snNumberLength = snNumber.length;
let startNumber = parseInt(snNumber);
for (let i = 0; i <quantity; i++) {
// 计算当前SN码的数字部分
let currentNumber = startNumber + i;
// 保持原有的数字位数格式(补零)
let formattedNumber = String(currentNumber).padStart(snNumberLength, '0');
// 组合完整的SN码
let currentSn = snPrefix + formattedNumber;
// 构造当前行数据
let rowData = {
productSn: currentSn,
productCode: $('#productCode').val(),
model: $('#model').val(),
productDesc: $('#productDesc').val(),
innerPrice: $('#innerPrice').val(),
warehouseId: $('#warehouseId').val(),
warehouseName: $('#addInventoryForm select[name="warehouseId"] option:selected').text(),
};
data.push(rowData);
}
$("#bootstrap-table").bootstrapTable('load', data);
layer.close(index)
}else{
$.modal.msgError("请填写完整信息");
return
}
},
end: function () {
parent.$('.layui-layer-btn').css('display', '')
// layer.msg('关闭后的回调', {icon:6});
}
});
}
function submitHandler() {
if ($.validate.form()) {
// 获取表格数据
var tableData = $("#bootstrap-table").bootstrapTable('getData');
// 检查是否有数据
if (tableData.length === 0) {
$.modal.alertWarning("请至少添加一条产品信息");
return false;
}
// 构造提交数据
var submitData = {
vendorCode: $('[name="vendorCode"]').val(),
inventoryInfoList: tableData
};
var config = {
url: prefix + "/add",
type: "post",
dataType: "json",
contentType: "application/json",
data: JSON.stringify(submitData),
beforeSend: function () {
$.modal.loading("正在处理中,请稍候...");
$.modal.disable();
},
success: function (result) {
if (typeof callback == "function") {
callback(result);
}
$.operate.successCallback(result);
}
};
$.ajax(config)
}
}
$(function () {
initTable()
getCurrentVendor()
$('.fixed-table-toolbar').css('display', 'none')
})
function initTable(data) {
var options = {
data: data,
sidePagination: "client",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return $.table.serialNumber(index);
}
},
{
field: 'id',
title: '',
visible: false
},
{
field: 'productSn',
title: 'SN码'
},
{
field: 'productCode',
title: '产品编码'
},
{
field: 'model',
title: '产品型号'
},
{
field: 'productDesc',
title: '产品描述'
},
{
field: 'innerPrice',
title: '入库价(含税)'
},
{
field: 'warehouseName',
title: '仓库'
},
{
field: 'warehouseId',
title: '仓库',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs " href="javascript:void(0)" onclick="removeRow(' + row.productSn + ')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
}
function removeRow(productSn) {
top.layer.confirm("确认要删除选中的数据吗?", {
icon: 3,
title: "警告",
btn: ['确认', '取消']
}, function (index) {
// 获取当前表格数据
let tableData = $("#bootstrap-table").bootstrapTable('getData');
// 查找要删除的行索引
var deleteIndex = tableData.findIndex(item => item.productSn == productSn);
if (deleteIndex > -1) {
// 从前端数据中移除
tableData.splice(deleteIndex, 1);
// 刷新表格显示
$("#bootstrap-table").bootstrapTable('load', tableData);
// 如果需要调用后端接口删除,可以在这里添加
// $.operate.remove(prefix + "/removeDetail", productSn); // 假设有这样的接口
}
top.layer.close(index);
});
}
function downloadTem() {
$.modal.loading("正在下载,请稍候...");
$.post(prefix + "/export/template", {}, function (result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
})
}
function importList() {
$('#uploadInput').click()
}
document.getElementById('uploadInput').addEventListener('change', function (event) {
const file = event.target.files[0];
let data = new FormData()
data.append('file', file)
var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
xhr.open('POST', prefix + '/importData', true); // 设置请求类型和URL
// 当请求完成时执行的回调函数
xhr.onload = function (res) {
let data = JSON.parse(res.currentTarget.response)
if (data.code === 0) {
$.modal.msgSuccess('上传成功');
$.table.refreshOptions({data: data})
} else {
top.layer.alert(data.msg || '导入失败', {
icon: 2,
title: "系统提示",
btn: ['确认'],
skin: 'content-br',
btnclass: ['btn btn-primary'],
});
}
$('#uploadInput').val('')
};
// 当请求发生错误时执行的回调函数
xhr.onerror = function () {
console.log('上传过程中发生错误');
};
//
// // 发送数据到服务器
xhr.send(data);
});
</script>
</body>
</html>

View File

@ -0,0 +1,136 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改入库单信息')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inner-edit" th:object="${omsInventoryInner}">
<input name="id" th:field="*{id}" type="hidden">
<div class="col-xs-12">
<h2>入库信息</h2>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-5 control-label ">入库单号:</label>
<div class="col-sm-7">
<input name="innerCode" class="form-control" type="text" th:field="*{innerCode}" readonly
placeholder="保存后自动生成"/>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-5 control-label is-required">制造商:</label>
<div class="col-sm-7">
<input name="vendorCode" class="form-control" th:field="*{vendorName}" type="text" required>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-5 control-label">入库时间:</label>
<div class="col-sm-7">
<input name="createTime" class="form-control" type="text"
th:value="*{#dates.format(createTime,'yyyy-MM-dd')}" readonly placeholder="保存后自动生成"/>
</div>
</div>
</div>
<div class="col-xs-12">
<h2>产品信息</h2>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var prefix = ctx + "inventory/inner";
var inventoryPrefix = ctx + "inventory/info";
$("#form-inner-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-inner-edit').serialize());
}
}
$(function () {
parent.$('.layui-layer-btn0').css('display', 'none')
if ([[${view}]]) {
$('input').attr("readonly", "true")
}
initTable()
})
function initTable(data) {
var options = {
url: inventoryPrefix + "/list",
queryParams: function (params) {
table.set();
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
searchValue: params.search,
orderByColumn: params.sort,
isAsc: params.order,
innerCode: [[${omsInventoryInner.innerCode}]]
};
return curParams
},
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return $.table.serialNumber(index);
}
},
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'productSn',
title: 'SN码'
},
{
field: 'productCode',
title: '产品编码'
},
{
field: 'model',
title: '产品型号'
},
{
field: 'productDesc',
title: '产品描述'
},
{
field: 'innerPrice',
title: '入库价(含税)'
},
{
field: 'warehouseName',
title: '入库仓'
},
{
field: 'warehouseId',
title: '入库仓',
visible: false
}]
};
$.table.init(options);
}
</script>
</body>
</html>

View File

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('入库单信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>入库单号:</label>
<input type="text" name="innerCode"/>
</li>
<li>
<label>产品编码:</label>
<input type="text" name="productCode"/>
</li>
<li>
<label>数量:</label>
<input type="text" name="quantity"/>
</li>
<li>
<label>经办人:</label>
<input type="text" name="createBy"/>
</li>
<li class="select-time">
<label>入库时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="inventory:inner:add">
<i class="fa fa-plus"></i> 添加
</a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="inventory:inner:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="inventory:inner:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="inventory:inner:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('inventory:inner:edit')}]];
var removeFlag = [[${@permission.hasPermi('inventory:inner:remove')}]];
var prefix = ctx + "inventory/inner";
function viewFull(id){
var url = prefix + "/view/" + id;
$.modal.openFull("查看详情", url);
}
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
viewUrl: prefix + "/view/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "入库单信息",
columns: [{
checkbox: true
},
{
field: 'id',
title: '',
visible: false
},
{
field: 'innerCode',
title: '入库单号'
},
{
field: 'productCode',
title: '产品编码'
},
{
field: 'quantity',
title: '数量'
},
{
field: 'vendorName',
title: '制造商'
},
{
field: 'warehouseName',
title: '入库仓'
},
{
field: 'createByName',
title: '经办人'
},
{
field: 'createTime',
title: '入库时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="viewFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -104,6 +104,7 @@
<!-- JS 函数引用或内联 --> <!-- JS 函数引用或内联 -->
<script th:inline="javascript"> /*<![CDATA[*/ <script th:inline="javascript"> /*<![CDATA[*/
const updatePriceProductList=['8813A3YA','8813A3YB','8813A7U4','8813A7U2'] const updatePriceProductList=['8813A3YA','8813A3YB','8813A7U4','8813A7U2']
const quantityStep = ['3130A4TE']
const FOLD_ON_FOLD = 0.988; const FOLD_ON_FOLD = 0.988;
const productType=[{ const productType=[{
name:'softwareProjectProductInfoList', name:'softwareProjectProductInfoList',
@ -296,7 +297,10 @@
let title=productTypeParam.title let title=productTypeParam.title
let submitName=productTypeParam.name let submitName=productTypeParam.name
let quantityStepFlag = false;
if (data) {
quantityStepFlag = quantityStep.filter(item => item === data.productBomCode).length > 0;
}
if (data){ if (data){
flag =! updatePriceProductList.filter(item=>item===data.productBomCode).length>0; flag =! updatePriceProductList.filter(item=>item===data.productBomCode).length>0;
} }
@ -306,7 +310,7 @@
<td class="product-bom-code-column"> <input type="hidden" name="${submitName}[${length}].id" value="${data.id || ''}"><input class="form-control productBomCode" type="text" onclick="selectProduct('${queryParam}','${title}',this)" value="${data.productBomCode || ''}" name="${submitName}[${length}].productBomCode"></td> <td class="product-bom-code-column"> <input type="hidden" name="${submitName}[${length}].id" value="${data.id || ''}"><input class="form-control productBomCode" type="text" onclick="selectProduct('${queryParam}','${title}',this)" value="${data.productBomCode || ''}" name="${submitName}[${length}].productBomCode"></td>
<td class="model-column"><input readonly class="form-control model" type="text" onclick="selectProduct('${queryParam}','${title}',this)" value="${data.model || ''}" name="${submitName}[${length}].model"></td> <td class="model-column"><input readonly class="form-control model" type="text" onclick="selectProduct('${queryParam}','${title}',this)" value="${data.model || ''}" name="${submitName}[${length}].model"></td>
<td class="product-desc-column"><textarea name="${submitName}[${length}].productDesc" required class="form-control productDesc" placeholder="自动带入" readonly>${data.productDesc || ''}</textarea></td> <td class="product-desc-column"><textarea name="${submitName}[${length}].productDesc" required class="form-control productDesc" placeholder="自动带入" readonly>${data.productDesc || ''}</textarea></td>
<td class="quantity-column"><input value="${data.quantity || ''}" name="${submitName}[${length}].quantity" type="number" class="form-control quantity" step="1" required></td> <td class="quantity-column"><input value="${data.quantity || ''}" name="${submitName}[${length}].quantity" type="number" class="form-control quantity" step="${quantityStepFlag ? 0.1 : 1}" required></td>
<td class="catalogue-price-column"><input value="${data.cataloguePrice || ''}" name="${submitName}[${length}].cataloguePrice" readonly type="hidden" class="form-control cataloguePrice" required> <td class="catalogue-price-column"><input value="${data.cataloguePrice || ''}" name="${submitName}[${length}].cataloguePrice" readonly type="hidden" class="form-control cataloguePrice" required>
<input value="${data.cataloguePriceFormmat || ''}" ${flag?"readonly":''} onfocus="getData(this,'cataloguePrice')" onblur="this.value=formatAmountNumber(this.value)" type="text" class="form-control catalogue-price-format" required> <input value="${data.cataloguePriceFormmat || ''}" ${flag?"readonly":''} onfocus="getData(this,'cataloguePrice')" onblur="this.value=formatAmountNumber(this.value)" type="text" class="form-control catalogue-price-format" required>
</td> </td>
@ -490,11 +494,12 @@
$(ele).parent().parent().find('.cataloguePrice').val(rows[0].cataloguePrice) $(ele).parent().parent().find('.cataloguePrice').val(rows[0].cataloguePrice)
$(ele).parent().parent().find('.catalogue-price-format').val(formatAmountNumber(rows[0].cataloguePrice)) $(ele).parent().parent().find('.catalogue-price-format').val(formatAmountNumber(rows[0].cataloguePrice))
let flag = updatePriceProductList.filter(item=>item===rows[0].productCode).length>0; let flag = updatePriceProductList.filter(item=>item===rows[0].productCode).length>0;
if (flag){ $(ele).parent().parent().find('.catalogue-price-format').attr('readonly',!flag)
$(ele).parent().parent().find('.catalogue-price-format').attr('readonly',false) let quantityStepFlag = quantityStep.filter(item => item === rows[0].productCode).length > 0;
// $(ele).parent().parent().find('.guidance-discount-format').attr('readonly',false) let quantityElement = $(ele).parent().parent().find('.quantity');
}else{ quantityElement.attr('step', quantityStepFlag ? 0.1 : 1)
$(ele).parent().parent().find('.catalogue-price-format').attr('readonly',true) if (!quantityStepFlag && quantityElement.val()) {
quantityElement.val(parseInt(quantityElement.val()))
} }
$.modal.close(index); $.modal.close(index);
} }

View File

@ -46,6 +46,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-2 control-label">默认仓库:</label>
<div class="col-sm-10">
<select name="warehouseId" class="form-control" th:with="type=${warehouseList}">
<option th:each="dict : ${type}" th:text="${dict.warehouseName}"
th:value="${dict.id}" ></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">生产地址:</label> <label class="col-sm-2 control-label">生产地址:</label>

View File

@ -59,6 +59,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-2 control-label">默认仓库:</label>
<div class="col-sm-10">
<select name="warehouseId" class="form-control" th:with="type=${warehouseList}">
<option th:each="dict : ${type}" th:text="${dict.warehouseName}"
th:value="${dict.id}" th:field="*{warehouseId}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12"> <div class="col-xs-12">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">生产地址:</label> <label class="col-sm-2 control-label">生产地址:</label>

View File

@ -109,6 +109,11 @@
width: '600', width: '600',
field: 'vendorAddress', field: 'vendorAddress',
title: '生产地址' title: '生产地址'
},
{
width: '100',
field: 'warehouseName',
title: '默认仓库'
}, },
{ {
width: '100', width: '100',

View File

@ -0,0 +1,101 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增仓库基础信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-info-add">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">仓库名称:</label>
<div class="col-sm-8">
<input name="warehouseName" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">仓库编码:</label>
<div class="col-sm-8">
<input name="warehouseCode" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">类型:</label>
<div class="col-sm-8">
<select name="warehouseType" class="form-control" th:with="type=${@dict.getType('warehouse_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">状态:</label>
<div class="col-sm-8">
<select name="warehouseStatus" class="form-control" th:with="type=${@dict.getType('warehouse_status')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">详细地址:</label>
<div class="col-sm-8">
<textarea name="address" class="form-control"></textarea>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-8">
<input name="managerName" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">联系人电话:</label>
<div class="col-sm-8">
<input name="managerPhone" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">联系人邮件:</label>
<div class="col-sm-8">
<input name="managerEmail" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "warehouse/info"
$("#form-info-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-info-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改仓库基础信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-info-edit" th:object="${omsWarehouseInfo}">
<input name="id" th:field="*{id}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">仓库名称:</label>
<div class="col-sm-8">
<input name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">仓库编码:</label>
<div class="col-sm-8">
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">类型:</label>
<div class="col-sm-8">
<select name="warehouseType" class="form-control" th:with="type=${@dict.getType('warehouse_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseType}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">状态:</label>
<div class="col-sm-8">
<select name="warehouseStatus" class="form-control" th:with="type=${@dict.getType('warehouse_status')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStatus}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">详细地址:</label>
<div class="col-sm-8">
<textarea name="address" class="form-control">[[*{address}]]</textarea>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">联系人:</label>
<div class="col-sm-8">
<input name="managerName" th:field="*{managerName}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">联系人电话:</label>
<div class="col-sm-8">
<input name="managerPhone" th:field="*{managerPhone}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">联系人邮件:</label>
<div class="col-sm-8">
<input name="managerEmail" th:field="*{managerEmail}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "warehouse/info";
$("#form-info-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,161 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('仓库基础信息列表')" />
</head>
<style>
.select-list li p, .select-list li label:not(.radio-box){
width: 80px;
}
</style>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>仓库名称:</label>
<input type="text" name="warehouseName"/>
</li>
<li>
<label>仓库编码:</label>
<input type="text" name="warehouseCode"/>
</li>
<li>
<label>类型:</label>
<select name="warehouseType" th:with="type=${@dict.getType('warehouse_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>状态:</label>
<select name="warehouseStatus" th:with="type=${@dict.getType('warehouse_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>联系人:</label>
<input type="text" name="managerName"/>
</li>
<li>
<label>联系人电话:</label>
<input type="text" name="managerPhone"/>
</li>
<li>
<label>联系人邮件:</label>
<input type="text" name="managerEmail"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="warehouse:info:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="warehouse:info:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="warehouse:info:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="warehouse:info:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('warehouse:info:edit')}]];
var removeFlag = [[${@permission.hasPermi('warehouse:info:remove')}]];
var warehouseTypeDatas = [[${@dict.getType('warehouse_type')}]];
var warehouseStatusDatas = [[${@dict.getType('warehouse_status')}]];
var prefix = ctx + "warehouse/info";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "仓库基础信息",
columns: [{
checkbox: true
},
{
field: 'id',
title: '',
visible: false
},
{
field: 'warehouseName',
title: '仓库名称'
},
{
field: 'warehouseCode',
title: '仓库编码'
},
{
field: 'warehouseType',
title: '类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(warehouseTypeDatas, value);
}
},
{
field: 'warehouseStatus',
title: '状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(warehouseStatusDatas, value);
}
},
{
field: 'address',
title: '详细地址'
},
{
field: 'managerName',
title: '联系人'
},
{
field: 'managerPhone',
title: '联系人电话'
},
{
field: 'managerEmail',
title: '联系人邮件'
},
{
field: 'remark',
title: '备注'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,143 @@
package com.ruoyi.sip.controller;
import java.util.List;
import com.ruoyi.sip.dto.inventory.GroupInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.service.IInventoryInfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ch
* @date 2025-08-07
*/
@Controller
@RequestMapping("/inventory/info")
public class InventoryInfoController extends BaseController
{
private String prefix = "inventory/info";
@Autowired
private IInventoryInfoService inventoryInfoService;
@RequiresPermissions("inventory:info:view")
@GetMapping()
public String info()
{
return prefix + "/info";
}
/**
*
*/
// @RequiresPermissions("inventory:info:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(InventoryInfo inventoryInfo)
{
startPage();
List<InventoryInfo> list = inventoryInfoService.selectInventoryInfoList(inventoryInfo);
return getDataTable(list);
}
@PostMapping("/group/list")
@ResponseBody
public TableDataInfo groupList(GroupInfo info)
{
startPage();
List<GroupInfo> list = inventoryInfoService.listGroup(info);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("inventory:info:export")
@Log(title = "产品库存", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(InventoryInfo inventoryInfo)
{
List<InventoryInfo> list = inventoryInfoService.selectInventoryInfoList(inventoryInfo);
ExcelUtil<InventoryInfo> util = new ExcelUtil<InventoryInfo>(InventoryInfo.class);
return util.exportExcel(list, "产品库存数据");
}
/**
*
*/
@RequiresPermissions("inventory:info:add")
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("inventory:info:add")
@Log(title = "产品库存", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(InventoryInfo inventoryInfo)
{
return toAjax(inventoryInfoService.insertInventoryInfo(inventoryInfo));
}
/**
*
*/
@RequiresPermissions("inventory:info:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
InventoryInfo inventoryInfo = inventoryInfoService.selectInventoryInfoById(id);
mmap.put("inventoryInfo", inventoryInfo);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("inventory:info:edit")
@Log(title = "产品库存", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(InventoryInfo inventoryInfo)
{
return toAjax(inventoryInfoService.updateInventoryInfo(inventoryInfo));
}
@GetMapping("/innerLog/{productCode}")
public String view(@PathVariable("productCode") String productCode, ModelMap mmap) {
mmap.put("productCode", productCode);
return prefix + "/innerLog";
}
/**
*
*/
@RequiresPermissions("inventory:info:remove")
@Log(title = "产品库存", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(inventoryInfoService.deleteInventoryInfoByIds(ids));
}
}

View File

@ -0,0 +1,162 @@
package com.ruoyi.sip.controller;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
import com.ruoyi.sip.service.IInventoryInfoService;
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.OmsInventoryInner;
import com.ruoyi.sip.service.IOmsInventoryInnerService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* Controller
*
* @author ruoyi
* @date 2025-08-06
*/
@Controller
@RequestMapping("/inventory/inner")
public class OmsInventoryInnerController extends BaseController {
private String prefix = "inventory/inner";
@Autowired
private IOmsInventoryInnerService omsInventoryInnerService;
@Autowired
private IInventoryInfoService inventoryInfoService;
@Autowired
private IOmsWarehouseInfoService warehouseInfoService;
@RequiresPermissions("inventory:inner:view")
@GetMapping()
public String inner() {
return prefix + "/inner";
}
/**
*
*/
@RequiresPermissions("inventory:inner:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OmsInventoryInner omsInventoryInner) {
startPage();
List<OmsInventoryInner> list = omsInventoryInnerService.selectOmsInventoryInnerList(omsInventoryInner);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("inventory:inner:export")
@Log(title = "入库单信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OmsInventoryInner omsInventoryInner) {
List<OmsInventoryInner> list = omsInventoryInnerService.selectOmsInventoryInnerList(omsInventoryInner);
ExcelUtil<OmsInventoryInner> util = new ExcelUtil<OmsInventoryInner>(OmsInventoryInner.class);
return util.exportExcel(list, "入库单信息数据");
}
/**
*
*/
@RequiresPermissions("inventory:inner:add")
@GetMapping("/add")
public String add(ModelMap modelMap) {
OmsWarehouseInfo queryWarehouseParam = new OmsWarehouseInfo();
queryWarehouseParam.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
modelMap.put("warehouseList", warehouseInfoService.selectOmsWarehouseInfoList(queryWarehouseParam));
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("inventory:inner:add")
@Log(title = "入库单信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@RequestBody OmsInventoryInner omsInventoryInner) {
return toAjax(omsInventoryInnerService.insertOmsInventoryInner(omsInventoryInner));
}
/**
*
*/
@RequiresPermissions("inventory:inner:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
OmsInventoryInner omsInventoryInner = omsInventoryInnerService.selectOmsInventoryInnerById(id);
mmap.put("omsInventoryInner", omsInventoryInner);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("inventory:inner:view")
@GetMapping("/view/{id}")
public String view(@PathVariable("id") Long id, ModelMap mmap) {
OmsInventoryInner omsInventoryInner = omsInventoryInnerService.selectOmsInventoryInnerById(id);
mmap.put("omsInventoryInner", omsInventoryInner);
mmap.put("view",true);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("inventory:inner:edit")
@Log(title = "入库单信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(OmsInventoryInner omsInventoryInner) {
return toAjax(omsInventoryInnerService.updateOmsInventoryInner(omsInventoryInner));
}
/**
*
*/
@RequiresPermissions("inventory:inner:remove")
@Log(title = "入库单信息", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(omsInventoryInnerService.deleteOmsInventoryInnerByIds(ids));
}
@PostMapping("/export/template")
@ResponseBody
public AjaxResult exportTemplate(){
ExcelUtil<WarehouseInnerExcelDto> util = new ExcelUtil<WarehouseInnerExcelDto>(WarehouseInnerExcelDto.class);
return util.exportExcel(Collections.emptyList(), "入库数据");
}
@PostMapping("/importData")
@ResponseBody
public TableDataInfo importData(MultipartFile file) throws IOException {
ExcelUtil<WarehouseInnerExcelDto> util = new ExcelUtil<WarehouseInnerExcelDto>(WarehouseInnerExcelDto.class);
List<WarehouseInnerExcelDto> excelList = util.importExcel(file.getInputStream());
List<InventoryInfo> inventoryInfos = inventoryInfoService.fillBaseInfo(excelList);
return getDataTable(inventoryInfos);
}
}

View File

@ -0,0 +1,128 @@
package com.ruoyi.sip.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-08-05
*/
@Controller
@RequestMapping("/warehouse/info")
public class OmsWarehouseInfoController extends BaseController
{
private String prefix = "warehouse/info";
@Autowired
private IOmsWarehouseInfoService omsWarehouseInfoService;
@RequiresPermissions("warehouse:info:view")
@GetMapping()
public String info()
{
return prefix + "/info";
}
/**
*
*/
@RequiresPermissions("warehouse:info:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OmsWarehouseInfo omsWarehouseInfo)
{
startPage();
List<OmsWarehouseInfo> list = omsWarehouseInfoService.selectOmsWarehouseInfoList(omsWarehouseInfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("warehouse:info:export")
@Log(title = "仓库基础信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OmsWarehouseInfo omsWarehouseInfo)
{
List<OmsWarehouseInfo> list = omsWarehouseInfoService.selectOmsWarehouseInfoList(omsWarehouseInfo);
ExcelUtil<OmsWarehouseInfo> util = new ExcelUtil<OmsWarehouseInfo>(OmsWarehouseInfo.class);
return util.exportExcel(list, "仓库基础信息数据");
}
/**
*
*/
@RequiresPermissions("warehouse:info:add")
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("warehouse:info:add")
@Log(title = "仓库基础信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(OmsWarehouseInfo omsWarehouseInfo)
{
return toAjax(omsWarehouseInfoService.insertOmsWarehouseInfo(omsWarehouseInfo));
}
/**
*
*/
@RequiresPermissions("warehouse:info:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
OmsWarehouseInfo omsWarehouseInfo = omsWarehouseInfoService.selectOmsWarehouseInfoById(id);
mmap.put("omsWarehouseInfo", omsWarehouseInfo);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("warehouse:info:edit")
@Log(title = "仓库基础信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(OmsWarehouseInfo omsWarehouseInfo)
{
return toAjax(omsWarehouseInfoService.updateOmsWarehouseInfo(omsWarehouseInfo));
}
/**
*
*/
@RequiresPermissions("warehouse:info:remove")
@Log(title = "仓库基础信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(omsWarehouseInfoService.deleteOmsWarehouseInfoByIds(ids));
}
}

View File

@ -1,7 +1,9 @@
package com.ruoyi.sip.controller; package com.ruoyi.sip.controller;
import java.util.Collections;
import java.util.List; import java.util.List;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.sip.domain.MaintenanceRecordsDto; import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.VendorInfo; import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IVendorInfoService; import com.ruoyi.sip.service.IVendorInfoService;
@ -59,6 +61,17 @@ public class ProductInfoController extends BaseController
List<ProductInfo> list = productInfoService.selectProductInfoList(productInfo); List<ProductInfo> list = productInfoService.selectProductInfoList(productInfo);
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/query/{productCode}")
@ResponseBody
public AjaxResult queryByCode(@PathVariable("productCode") String productCode)
{
List<ProductInfo> list = productInfoService.selectProductInfoByCodeList(Collections.singletonList(productCode));
if (CollUtil.isEmpty(list)){
return AjaxResult.error("未找到该产品");
}
return AjaxResult.success(list.get(0));
}
/** /**
* *

View File

@ -135,7 +135,7 @@ public class ProjectInfoController extends BaseController
List<ProjectOrderInfo> orderInfoList = orderInfoService.selectProjectOrderInfoByProjectId(Collections.singletonList(id)); List<ProjectOrderInfo> orderInfoList = orderInfoService.selectProjectOrderInfoByProjectId(Collections.singletonList(id));
ProjectOrderInfo orderInfo = CollUtil.isNotEmpty(orderInfoList) ? orderInfoList.get(0) : null; ProjectOrderInfo orderInfo = CollUtil.isNotEmpty(orderInfoList) ? orderInfoList.get(0) : null;
mmap.put("orderInfo", orderInfo); mmap.put("orderInfo", orderInfo);
mmap.put("canUpdate", true); mmap.put("canUpdate", orderInfo == null || orderInfo.getOrderStatus().equals(ProjectOrderInfo.OrderStatus.WAIT_COMMIT.getCode()));
return prefix + "/edit"; return prefix + "/edit";
} }
@GetMapping("/view/{id}") @GetMapping("/view/{id}")
@ -151,7 +151,7 @@ public class ProjectInfoController extends BaseController
} }
@GetMapping("/query/{id}") @GetMapping("/query/{id}")
@ResponseBody @ResponseBody
public AjaxResult edit(@PathVariable("id") Long id) public AjaxResult query(@PathVariable("id") Long id)
{ {
ProjectInfo projectInfo = projectInfoService.selectProjectInfoById(id); ProjectInfo projectInfo = projectInfoService.selectProjectInfoById(id);
return AjaxResult.success(projectInfo); return AjaxResult.success(projectInfo);

View File

@ -4,15 +4,21 @@ import java.io.File;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.qrcode.QrCodeUtil; import cn.hutool.extra.qrcode.QrCodeUtil;
import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DictUtils; import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.domain.VendorInfo; import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -46,6 +52,8 @@ public class VendorInfoController extends BaseController
@Autowired @Autowired
private IVendorInfoService vendorInfoService; private IVendorInfoService vendorInfoService;
@Autowired
private IOmsWarehouseInfoService warehouseInfoService;
@RequiresPermissions("system:vendor:view") @RequiresPermissions("system:vendor:view")
@GetMapping() @GetMapping()
@ -106,8 +114,11 @@ public class VendorInfoController extends BaseController
*/ */
@RequiresPermissions("system:vendor:add") @RequiresPermissions("system:vendor:add")
@GetMapping("/add") @GetMapping("/add")
public String add() public String add(ModelMap mmap)
{ {
OmsWarehouseInfo queryWarehouseParam = new OmsWarehouseInfo();
queryWarehouseParam.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
mmap.put("warehouseList", warehouseInfoService.selectOmsWarehouseInfoList(queryWarehouseParam));
return prefix + "/add"; return prefix + "/add";
} }
@ -132,6 +143,9 @@ public class VendorInfoController extends BaseController
{ {
VendorInfo vendorInfo = vendorInfoService.selectVendorInfoByVendorId(vendorId); VendorInfo vendorInfo = vendorInfoService.selectVendorInfoByVendorId(vendorId);
mmap.put("vendorInfo", vendorInfo); mmap.put("vendorInfo", vendorInfo);
OmsWarehouseInfo queryWarehouseParam = new OmsWarehouseInfo();
queryWarehouseParam.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
mmap.put("warehouseList", warehouseInfoService.selectOmsWarehouseInfoList(queryWarehouseParam));
mmap.put("update", true); mmap.put("update", true);
return prefix + "/edit"; return prefix + "/edit";
} }
@ -144,6 +158,9 @@ public class VendorInfoController extends BaseController
{ {
VendorInfo vendorInfo = vendorInfoService.selectVendorInfoByVendorId(vendorId); VendorInfo vendorInfo = vendorInfoService.selectVendorInfoByVendorId(vendorId);
mmap.put("vendorInfo", vendorInfo); mmap.put("vendorInfo", vendorInfo);
OmsWarehouseInfo queryWarehouseParam = new OmsWarehouseInfo();
queryWarehouseParam.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
mmap.put("warehouseList", warehouseInfoService.selectOmsWarehouseInfoList(queryWarehouseParam));
mmap.put("update", false); mmap.put("update", false);
return prefix + "/edit"; return prefix + "/edit";
} }
@ -160,6 +177,15 @@ public class VendorInfoController extends BaseController
return toAjax(vendorInfoService.updateVendorInfo(vendorInfo)); return toAjax(vendorInfoService.updateVendorInfo(vendorInfo));
} }
@GetMapping("/current")
@ResponseBody
public AjaxResult current() {
List<VendorInfo> vendorInfo = vendorInfoService.current();
if (CollUtil.isEmpty(vendorInfo)) {
return AjaxResult.success();
}
return success(vendorInfo.get(0));
}
/** /**
* *
*/ */

View File

@ -0,0 +1,77 @@
package com.ruoyi.sip.domain;
import java.math.BigDecimal;
import lombok.Data;
import lombok.Getter;
import lombok.ToString;
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;
/**
* oms_inventory_info
*
* @author ch
* @date 2025-08-07
*/
@Data
@ToString
public class InventoryInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long id;
/** 产品编码 */
@Excel(name = "产品编码")
private String productCode;
private String model;
private String productDesc;
/** 产品序列号 */
@Excel(name = "产品序列号")
private String productSn;
/** 库存状态(0 入库 1出库) */
@Excel(name = "库存状态(0 入库 1出库)")
private String inventoryStatus;
/** 入库单号 */
@Excel(name = "入库单号")
private String innerCode;
/** 出库单号 */
@Excel(name = "出库单号")
private String outerCode;
/** 所属仓库 */
@Excel(name = "所属仓库")
private Long warehouseId;
private String warehouseName;
/** 入库价 */
@Excel(name = "入库价")
private BigDecimal innerPrice;
/** 出库价 */
@Excel(name = "出库价")
private BigDecimal outerPrice;
@Getter
public enum InventoryStatusEnum {
INNER("0","入库"),
OUTER("1","出库");
private final String code;
private final String desc;
InventoryStatusEnum(String code,String desc) {
this.code = code;
this.desc = desc;
}
}
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.sip.domain;
import lombok.Data;
import lombok.ToString;
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;
import java.util.Date;
import java.util.List;
/**
* oms_inventory_inner
*
* @author ruoyi
* @date 2025-08-06
*/
@Data
@ToString
public class OmsInventoryInner extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
*
*/
@Excel(name = "入库单号")
private String innerCode;
/**
*
*/
@Excel(name = "产品编码")
private String productCode;
/**
*
*/
@Excel(name = "数量")
private Long quantity;
@Excel(name = "制造商")
private String vendorName;
private String vendorCode;
/**
*
*/
private Long warehouseId;
@Excel(name = "入库仓")
private String warehouseName;
@Excel(name = "经办人")
private String createByName;
@Excel(name = "入库时间",dateFormat="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private List<InventoryInfo> inventoryInfoList;
}

View File

@ -0,0 +1,82 @@
package com.ruoyi.sip.domain;
import lombok.Data;
import lombok.Getter;
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;
/**
* oms_warehouse_info
*
* @author ruoyi
* @date 2025-08-05
*/
@Data
public class OmsWarehouseInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long id;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 仓库编码 */
@Excel(name = "仓库编码")
private String warehouseCode;
/** 仓库类型 */
@Excel(name = "仓库类型")
private String warehouseType;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String warehouseStatus;
/** 仓库详细地址 */
@Excel(name = "仓库详细地址")
private String address;
/** 仓库管理员名称 */
@Excel(name = "仓库管理员名称")
private String managerName;
/** 仓库管理员电话 */
@Excel(name = "仓库管理员电话")
private String managerPhone;
/** 仓库管理员邮件 */
@Excel(name = "仓库管理员邮件")
private String managerEmail;
@Getter
public enum WarehouseStatusEnum {
NORMAL("0", "正常"),
DISABLE("1", "停用");
private final String value;
private final String desc;
WarehouseStatusEnum(String value, String code) {
this.value = value;
this.desc = code;
}
}
@Getter
public enum WarehouseTypeEnum {
PHYSICAL("0", "实体仓"),
VIRTUAL("1", "虚拟仓"),
;
private final String value;
private final String code;
WarehouseTypeEnum(String value, String code) {
this.value = value;
this.code = code;
}
}
}

View File

@ -5,6 +5,8 @@ import lombok.Getter;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/** /**
* varchar_info * varchar_info
* *
@ -26,6 +28,7 @@ public class VendorInfo extends BaseEntity
/** 制造商名称 */ /** 制造商名称 */
@Excel(name = "制造商名称") @Excel(name = "制造商名称")
private String vendorName; private String vendorName;
private List<String> vendorNameList;
/** 生产地址 */ /** 生产地址 */
@Excel(name = "生产地址") @Excel(name = "生产地址")
@ -47,6 +50,8 @@ public class VendorInfo extends BaseEntity
@Excel(name = "合作状态") @Excel(name = "合作状态")
private String vendorStatus; private String vendorStatus;
private String vendorStatusName; private String vendorStatusName;
private String warehouseName;
private String warehouseId;
@Getter @Getter
public enum VendorStatusEnum { public enum VendorStatusEnum {

View File

@ -0,0 +1,35 @@
package com.ruoyi.sip.dto.inventory;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
/**
* @author : ch
* @version : 1.0
* @ClassName : GroupInfo
* @Description :
* @DATE : Created in 17:32 2025/8/7
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/08/07 ch 1.0 Why & What is modified: <> *
*/
@Data
public class GroupInfo {
@Excel(name = "产品编码")
private String productCode;
@Excel(name = "产品型号")
private String model;
@Excel(name = "产品名称")
private String productName;
@Excel(name = "实时库存")
private Long availableCount;
@Excel(name = "累计发货")
private Long reservedCount;
@Excel(name = "制造商")
private String vendorName;
}

View File

@ -0,0 +1,37 @@
package com.ruoyi.sip.dto.warehouse;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
/**
* @author : ch
* @version : 1.0
* @ClassName : WarehouseInnerExcelDto
* @Description :
* @DATE : Created in 9:34 2025/8/7
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/08/07 ch 1.0 Why & What is modified: <> *
*/
@Data
@ToString
public class WarehouseInnerExcelDto {
@Excel(name = "序号")
private String index;
@Excel(name = "SN码")
private String productSn;
@Excel(name="产品编码")
private String productCode;
@Excel(name="入库价(含税)")
private BigDecimal innerPrice;
@Excel(name="入库仓")
private String warehouseName;
}

View File

@ -0,0 +1,66 @@
package com.ruoyi.sip.mapper;
import java.util.List;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.dto.inventory.GroupInfo;
/**
* Mapper
*
* @author ch
* @date 2025-08-07
*/
public interface InventoryInfoMapper
{
/**
*
*
* @param id
* @return
*/
public InventoryInfo selectInventoryInfoById(Long id);
/**
*
*
* @param inventoryInfo
* @return
*/
public List<InventoryInfo> selectInventoryInfoList(InventoryInfo inventoryInfo);
/**
*
*
* @param inventoryInfo
* @return
*/
public int insertInventoryInfo(InventoryInfo inventoryInfo);
/**
*
*
* @param inventoryInfo
* @return
*/
public int updateInventoryInfo(InventoryInfo inventoryInfo);
/**
*
*
* @param id
* @return
*/
public int deleteInventoryInfoById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteInventoryInfoByIds(String[] ids);
void saveBatch(List<InventoryInfo> inventoryInfoList);
List<GroupInfo> listGroup(GroupInfo inventoryInfo);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.sip.mapper;
import java.util.List;
import com.ruoyi.sip.domain.OmsInventoryInner;
/**
* Mapper
*
* @author ruoyi
* @date 2025-08-06
*/
public interface OmsInventoryInnerMapper
{
/**
*
*
* @param id
* @return
*/
public OmsInventoryInner selectOmsInventoryInnerById(Long id);
/**
*
*
* @param omsInventoryInner
* @return
*/
public List<OmsInventoryInner> selectOmsInventoryInnerList(OmsInventoryInner omsInventoryInner);
/**
*
*
* @param omsInventoryInner
* @return
*/
public int insertOmsInventoryInner(OmsInventoryInner omsInventoryInner);
/**
*
*
* @param omsInventoryInner
* @return
*/
public int updateOmsInventoryInner(OmsInventoryInner omsInventoryInner);
/**
*
*
* @param id
* @return
*/
public int deleteOmsInventoryInnerById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteOmsInventoryInnerByIds(String[] ids);
int selectMaxOrderCode(String code);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.sip.mapper;
import java.util.List;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
/**
* Mapper
*
* @author ruoyi
* @date 2025-08-05
*/
public interface OmsWarehouseInfoMapper
{
/**
*
*
* @param id
* @return
*/
public OmsWarehouseInfo selectOmsWarehouseInfoById(Long id);
/**
*
*
* @param omsWarehouseInfo
* @return
*/
public List<OmsWarehouseInfo> selectOmsWarehouseInfoList(OmsWarehouseInfo omsWarehouseInfo);
/**
*
*
* @param omsWarehouseInfo
* @return
*/
public int insertOmsWarehouseInfo(OmsWarehouseInfo omsWarehouseInfo);
/**
*
*
* @param omsWarehouseInfo
* @return
*/
public int updateOmsWarehouseInfo(OmsWarehouseInfo omsWarehouseInfo);
/**
*
*
* @param id
* @return
*/
public int deleteOmsWarehouseInfoById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteOmsWarehouseInfoByIds(String[] ids);
List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList);
}

View File

@ -0,0 +1,76 @@
package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.dto.inventory.GroupInfo;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
/**
* Service
*
* @author ch
* @date 2025-08-07
*/
public interface IInventoryInfoService
{
/**
*
*
* @param id
* @return
*/
public InventoryInfo selectInventoryInfoById(Long id);
/**
*
*
* @param inventoryInfo
* @return
*/
public List<InventoryInfo> selectInventoryInfoList(InventoryInfo inventoryInfo);
/**
*
*
* @param inventoryInfo
* @return
*/
public int insertInventoryInfo(InventoryInfo inventoryInfo);
/**
*
*
* @param inventoryInfo
* @return
*/
public int updateInventoryInfo(InventoryInfo inventoryInfo);
/**
*
*
* @param ids
* @return
*/
public int deleteInventoryInfoByIds(String ids);
/**
*
*
* @param id
* @return
*/
public int deleteInventoryInfoById(Long id);
/**
* excel
* @param excelList
* @return java.util.List<com.ruoyi.sip.domain.InventoryInfo>
* @author ch
* @date 2025/08/07 09:57
*/
List<InventoryInfo> fillBaseInfo(List<WarehouseInnerExcelDto> excelList);
void saveBatch(List<InventoryInfo> inventoryInfoList);
List<GroupInfo> listGroup(GroupInfo inventoryInfo);
}

View File

@ -0,0 +1,66 @@
package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.domain.OmsInventoryInner;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
/**
* Service
*
* @author ruoyi
* @date 2025-08-06
*/
public interface IOmsInventoryInnerService
{
/**
*
*
* @param id
* @return
*/
public OmsInventoryInner selectOmsInventoryInnerById(Long id);
/**
*
*
* @param omsInventoryInner
* @return
*/
public List<OmsInventoryInner> selectOmsInventoryInnerList(OmsInventoryInner omsInventoryInner);
/**
*
*
* @param omsInventoryInner
* @return
*/
public int insertOmsInventoryInner(OmsInventoryInner omsInventoryInner);
/**
*
*
* @param omsInventoryInner
* @return
*/
public int updateOmsInventoryInner(OmsInventoryInner omsInventoryInner);
/**
*
*
* @param ids
* @return
*/
public int deleteOmsInventoryInnerByIds(String ids);
/**
*
*
* @param id
* @return
*/
public int deleteOmsInventoryInnerById(Long id);
}

View File

@ -0,0 +1,68 @@
package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
/**
* Service
*
* @author ruoyi
* @date 2025-08-05
*/
public interface IOmsWarehouseInfoService
{
/**
*
*
* @param id
* @return
*/
public OmsWarehouseInfo selectOmsWarehouseInfoById(Long id);
/**
*
*
* @param omsWarehouseInfo
* @return
*/
public List<OmsWarehouseInfo> selectOmsWarehouseInfoList(OmsWarehouseInfo omsWarehouseInfo);
/**
*
*
* @param omsWarehouseInfo
* @return
*/
public int insertOmsWarehouseInfo(OmsWarehouseInfo omsWarehouseInfo);
/**
*
*
* @param omsWarehouseInfo
* @return
*/
public int updateOmsWarehouseInfo(OmsWarehouseInfo omsWarehouseInfo);
/**
*
*
* @param ids
* @return
*/
public int deleteOmsWarehouseInfoByIds(String ids);
/**
*
*
* @param id
* @return
*/
public int deleteOmsWarehouseInfoById(Long id);
/**
*
* @param warehouseNameList
* @return
*/
List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList);
}

View File

@ -60,4 +60,7 @@ public interface IVendorInfoService
* @return * @return
*/ */
public int deleteVendorInfoByVendorId(Long vendorId); public int deleteVendorInfoByVendorId(Long vendorId);
List<VendorInfo> current();
} }

View File

@ -0,0 +1,158 @@
package com.ruoyi.sip.service.impl;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.domain.ProductInfo;
import com.ruoyi.sip.dto.inventory.GroupInfo;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
import com.ruoyi.sip.service.IProductInfoService;
import liquibase.pro.packaged.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.InventoryInfoMapper;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.service.IInventoryInfoService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author ch
* @date 2025-08-07
*/
@Service
public class InventoryInfoServiceImpl implements IInventoryInfoService {
@Autowired
private InventoryInfoMapper inventoryInfoMapper;
@Autowired
private IProductInfoService productInfoService;
@Autowired
private IOmsWarehouseInfoService warehouseInfoService;
/**
*
*
* @param id
* @return
*/
@Override
public InventoryInfo selectInventoryInfoById(Long id) {
return inventoryInfoMapper.selectInventoryInfoById(id);
}
/**
*
*
* @param inventoryInfo
* @return
*/
@Override
public List<InventoryInfo> selectInventoryInfoList(InventoryInfo inventoryInfo) {
return inventoryInfoMapper.selectInventoryInfoList(inventoryInfo);
}
/**
*
*
* @param inventoryInfo
* @return
*/
@Override
public int insertInventoryInfo(InventoryInfo inventoryInfo) {
inventoryInfo.setCreateTime(DateUtils.getNowDate());
return inventoryInfoMapper.insertInventoryInfo(inventoryInfo);
}
/**
*
*
* @param inventoryInfo
* @return
*/
@Override
public int updateInventoryInfo(InventoryInfo inventoryInfo) {
inventoryInfo.setUpdateTime(DateUtils.getNowDate());
return inventoryInfoMapper.updateInventoryInfo(inventoryInfo);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteInventoryInfoByIds(String ids) {
return inventoryInfoMapper.deleteInventoryInfoByIds(Convert.toStrArray(ids));
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteInventoryInfoById(Long id) {
return inventoryInfoMapper.deleteInventoryInfoById(id);
}
@Override
public List<InventoryInfo> fillBaseInfo(List<WarehouseInnerExcelDto> excelList) {
if (CollUtil.isEmpty(excelList)) {
return Collections.emptyList();
}
List<String> productCodeList = excelList.stream().map(WarehouseInnerExcelDto::getProductCode)
.filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<ProductInfo> productInfos = productInfoService.selectProductInfoByCodeList(productCodeList);
Map<String, ProductInfo> productInfoMap = productInfos.stream()
.collect(Collectors.toMap(ProductInfo::getProductCode, Function.identity(), (v1, v2) -> v1));
List<String> warehouseNameList = excelList.stream().map(WarehouseInnerExcelDto::getWarehouseName)
.filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<OmsWarehouseInfo> omsWarehouseInfos = warehouseInfoService.listByNameList(warehouseNameList);
Map<String, OmsWarehouseInfo> warehouseInfoMap = omsWarehouseInfos.stream()
.collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
return excelList.stream().map(excel -> {
InventoryInfo inventoryInfo = new InventoryInfo();
inventoryInfo.setInventoryStatus(InventoryInfo.InventoryStatusEnum.INNER.getCode());
inventoryInfo.setProductCode(excel.getProductCode());
inventoryInfo.setProductSn(excel.getProductSn());
inventoryInfo.setInnerPrice(excel.getInnerPrice());
if (warehouseInfoMap.containsKey(excel.getWarehouseName())){
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(excel.getWarehouseName());
inventoryInfo.setWarehouseId(omsWarehouseInfo.getId());
inventoryInfo.setWarehouseName(omsWarehouseInfo.getWarehouseName());
}
if (productInfoMap.containsKey(excel.getProductCode())){
ProductInfo productInfo = productInfoMap.get(excel.getProductCode());
inventoryInfo.setModel(productInfo.getModel());
inventoryInfo.setProductDesc(productInfo.getDescription());
inventoryInfo.setProductCode(productInfo.getProductCode());
}
return inventoryInfo;
}).collect(Collectors.toList());
}
@Override
public void saveBatch(List<InventoryInfo> inventoryInfoList) {
inventoryInfoMapper.saveBatch(inventoryInfoList);
}
@Override
public List<GroupInfo> listGroup(GroupInfo inventoryInfo) {
return inventoryInfoMapper.listGroup(inventoryInfo);
}
}

View File

@ -0,0 +1,155 @@
package com.ruoyi.sip.service.impl;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
import com.ruoyi.sip.mapper.InventoryInfoMapper;
import com.ruoyi.sip.service.IInventoryInfoService;
import com.ruoyi.sip.service.IVendorInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.OmsInventoryInnerMapper;
import com.ruoyi.sip.domain.OmsInventoryInner;
import com.ruoyi.sip.service.IOmsInventoryInnerService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author ruoyi
* @date 2025-08-06
*/
@Service
public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
@Autowired
private OmsInventoryInnerMapper omsInventoryInnerMapper;
@Autowired
private IInventoryInfoService inventoryInfoService;
@Autowired
private IVendorInfoService vendorInfoService;
/**
*
*
* @param id
* @return
*/
@Override
public OmsInventoryInner selectOmsInventoryInnerById(Long id) {
return omsInventoryInnerMapper.selectOmsInventoryInnerById(id);
}
/**
*
*
* @param omsInventoryInner
* @return
*/
@Override
public List<OmsInventoryInner> selectOmsInventoryInnerList(OmsInventoryInner omsInventoryInner) {
if (!ShiroUtils.getSysUser().isAdmin()){
List<VendorInfo> current = vendorInfoService.current();
if (CollUtil.isEmpty(current)){
return Collections.emptyList();
}
omsInventoryInner.setVendorCode(current.get(0).getVendorCode());
}
return omsInventoryInnerMapper.selectOmsInventoryInnerList(omsInventoryInner);
}
/**
*
*
* @param omsInventoryInner
* @return
*/
@Override
public int insertOmsInventoryInner(OmsInventoryInner omsInventoryInner) {
//生成出库单
omsInventoryInner.setInnerCode(generateInnerCode());
Date nowDate = DateUtils.getNowDate();
omsInventoryInner.setCreateTime(nowDate);
String currentUserId = ShiroUtils.getUserId().toString();
omsInventoryInner.setCreateBy(currentUserId);
List<InventoryInfo> inventoryInfoList = omsInventoryInner.getInventoryInfoList();
if (CollUtil.isEmpty(inventoryInfoList)) {
return 0;
}
omsInventoryInner.setQuantity((long) inventoryInfoList.size());
List<String> productCodeList = inventoryInfoList.stream().map(InventoryInfo::getProductCode).distinct().filter(StringUtils::isNotEmpty).collect(Collectors.toList());
if (productCodeList.size() != 1) {
throw new ServiceException("添加产品信息中产品编码不允许多个");
}
omsInventoryInner.setProductCode(productCodeList.get(0));
List<Long> warehouseIdList = inventoryInfoList.stream().map(InventoryInfo::getWarehouseId).distinct().filter(Objects::nonNull).collect(Collectors.toList());
if (warehouseIdList.size() != 1) {
throw new ServiceException("添加产品信息中仓库不允许多个");
}
omsInventoryInner.setWarehouseId(warehouseIdList.get(0));
inventoryInfoList.forEach(item->{
item.setInnerCode(omsInventoryInner.getInnerCode());
item.setCreateBy(currentUserId);
item.setCreateTime(nowDate);
});
inventoryInfoService.saveBatch(inventoryInfoList);
return omsInventoryInnerMapper.insertOmsInventoryInner(omsInventoryInner);
}
private String generateInnerCode() {
StringBuilder code = new StringBuilder();
code.append("R-");
code.append(DateUtils.dateTime());
int count = omsInventoryInnerMapper.selectMaxOrderCode(code.toString());
code.append(String.format("%03d", count + 1));
return code.toString();
}
/**
*
*
* @param omsInventoryInner
* @return
*/
@Override
public int updateOmsInventoryInner(OmsInventoryInner omsInventoryInner) {
omsInventoryInner.setUpdateTime(DateUtils.getNowDate());
return omsInventoryInnerMapper.updateOmsInventoryInner(omsInventoryInner);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteOmsInventoryInnerByIds(String ids) {
return omsInventoryInnerMapper.deleteOmsInventoryInnerByIds(Convert.toStrArray(ids));
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteOmsInventoryInnerById(Long id) {
return omsInventoryInnerMapper.deleteOmsInventoryInnerById(id);
}
}

View File

@ -0,0 +1,126 @@
package com.ruoyi.sip.service.impl;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.OmsWarehouseInfoMapper;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author ruoyi
* @date 2025-08-05
*/
@Service
public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
@Autowired
private OmsWarehouseInfoMapper omsWarehouseInfoMapper;
/**
*
*
* @param id
* @return
*/
@Override
public OmsWarehouseInfo selectOmsWarehouseInfoById(Long id) {
return omsWarehouseInfoMapper.selectOmsWarehouseInfoById(id);
}
/**
*
*
* @param omsWarehouseInfo
* @return
*/
@Override
public List<OmsWarehouseInfo> selectOmsWarehouseInfoList(OmsWarehouseInfo omsWarehouseInfo) {
return omsWarehouseInfoMapper.selectOmsWarehouseInfoList(omsWarehouseInfo);
}
/**
*
*
* @param omsWarehouseInfo
* @return
*/
@Override
public int insertOmsWarehouseInfo(OmsWarehouseInfo omsWarehouseInfo) {
checkUnqCode(omsWarehouseInfo);
omsWarehouseInfo.setCreateTime(DateUtils.getNowDate());
omsWarehouseInfo.setCreateBy(ShiroUtils.getUserId().toString());
return omsWarehouseInfoMapper.insertOmsWarehouseInfo(omsWarehouseInfo);
}
private void checkUnqCode(OmsWarehouseInfo omsWarehouseInfo) {
OmsWarehouseInfo queryDto = new OmsWarehouseInfo();
queryDto.setWarehouseCode(omsWarehouseInfo.getWarehouseCode());
List<OmsWarehouseInfo> omsWarehouseInfos = omsWarehouseInfoMapper.selectOmsWarehouseInfoList(queryDto);
//code查询记录为空直接保存
if (CollUtil.isEmpty(omsWarehouseInfos)) {
return;
}
//是否新增
if (omsWarehouseInfo.getId() == null) {
throw new RuntimeException("仓库编码重复,保存失败");
}
//编辑需剔除当前数据
long count = omsWarehouseInfos.stream().filter(item -> !item.getId().equals(omsWarehouseInfo.getId())).count();
if (count > 0) {
throw new RuntimeException("仓库编码重复,保存失败");
}
}
/**
*
*
* @param omsWarehouseInfo
* @return
*/
@Override
public int updateOmsWarehouseInfo(OmsWarehouseInfo omsWarehouseInfo) {
checkUnqCode(omsWarehouseInfo);
omsWarehouseInfo.setUpdateTime(DateUtils.getNowDate());
omsWarehouseInfo.setUpdateBy(ShiroUtils.getUserId().toString());
return omsWarehouseInfoMapper.updateOmsWarehouseInfo(omsWarehouseInfo);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteOmsWarehouseInfoByIds(String ids) {
return omsWarehouseInfoMapper.deleteOmsWarehouseInfoByIds(Convert.toStrArray(ids));
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteOmsWarehouseInfoById(Long id) {
return omsWarehouseInfoMapper.deleteOmsWarehouseInfoById(id);
}
@Override
public List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList) {
if (CollUtil.isEmpty(warehouseNameList)){
return Collections.emptyList();
}
return omsWarehouseInfoMapper.listByNameList(warehouseNameList);
}
}

View File

@ -1,8 +1,12 @@
package com.ruoyi.sip.service.impl; package com.ruoyi.sip.service.impl;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
@ -110,4 +114,15 @@ public class VendorInfoServiceImpl implements IVendorInfoService {
public int deleteVendorInfoByVendorId(Long vendorId) { public int deleteVendorInfoByVendorId(Long vendorId) {
return vendorInfoMapper.deleteVendorInfoByVendorId(vendorId); return vendorInfoMapper.deleteVendorInfoByVendorId(vendorId);
} }
@Override
public List<VendorInfo> current() {
SysUser user = ShiroUtils.getSysUser();
if (user == null) {
throw new ServiceException("用户不存在");
}
VendorInfo queryParam = new VendorInfo();
queryParam.setVendorNameList(user.getRoles().stream().map(SysRole::getRoleName).collect(Collectors.toList()));
return vendorInfoMapper.selectVendorInfoList(queryParam);
}
} }

View File

@ -41,8 +41,8 @@ public class TemplateMailUtil {
* @Date 2025/07/29 09:55 * @Date 2025/07/29 09:55
*/ */
public static void sendTemplateMail(List<String> toEmail, String title, MailTemplate path, Dict dict) { public static void sendTemplateMail(List<String> toEmail, String title, MailTemplate path, Dict dict) {
String enbaled = SpringUtils.getProperty("unis.mail.enabled", "false"); String enabled = SpringUtils.getProperty("unis.mail.enabled", "false");
if (Boolean.getBoolean(enbaled)) { if (Boolean.getBoolean(enabled)) {
log.warn("邮件发送开关未开启"); log.warn("邮件发送开关未开启");
return; return;
} }
@ -72,7 +72,7 @@ public class TemplateMailUtil {
/** /**
* *
*/ */
ORDER_DELIVERY("mailOrderDeliveryTemplate.html","发货单"), ORDER_DELIVERY("mailOrderDeliveryTemplate.html","供应商通知发货单"),
; ;

View File

@ -0,0 +1,142 @@
<?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.sip.mapper.InventoryInfoMapper">
<resultMap type="InventoryInfo" id="InventoryInfoResult">
<result property="id" column="id" />
<result property="productCode" column="product_code" />
<result property="productSn" column="product_sn" />
<result property="inventoryStatus" column="inventory_status" />
<result property="innerCode" column="inner_code" />
<result property="outerCode" column="outer_code" />
<result property="warehouseId" column="warehouse_id" />
<result property="innerPrice" column="inner_price" />
<result property="outerPrice" column="outer_price" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectInventoryInfoVo">
select t1.id, t1.product_code, t1.product_sn, t1.inventory_status, t1.inner_code, t1.outer_code, t1.warehouse_id, t1.inner_price,
t1.outer_price, t1.create_by, t1.create_time, t1.update_by, t1.update_time ,
t2.warehouse_name,t3.description as 'product_desc',t3.model
from oms_inventory_info t1
left join oms_warehouse_info t2 on t1.warehouse_id = t2.id
left join product_info t3 on t1.product_code = t3.product_code
</sql>
<select id="selectInventoryInfoList" parameterType="InventoryInfo" resultMap="InventoryInfoResult">
<include refid="selectInventoryInfoVo"/>
<where>
<if test="productCode != null and productCode != ''"> and t1.product_code = #{productCode}</if>
<if test="productSn != null and productSn != ''"> and t1.product_sn = #{productSn}</if>
<if test="inventoryStatus != null and inventoryStatus != ''"> and t1.inventory_status = #{inventoryStatus}</if>
<if test="innerCode != null and innerCode != ''"> and t1.inner_code = #{innerCode}</if>
<if test="outerCode != null and outerCode != ''"> and t1.outer_code = #{outerCode}</if>
<if test="warehouseId != null "> and t1.warehouse_id = #{warehouseId}</if>
<if test="innerPrice != null "> and t1.inner_price = #{innerPrice}</if>
<if test="outerPrice != null "> and t1.outer_price = #{outerPrice}</if>
</where>
</select>
<select id="selectInventoryInfoById" parameterType="Long" resultMap="InventoryInfoResult">
<include refid="selectInventoryInfoVo"/>
where t1.id = #{id}
</select>
<select id="listGroup" resultType="com.ruoyi.sip.dto.inventory.GroupInfo">
select t1.product_code, t1.available_count, t1.reserved_count, t2.model, t2.product_name, t3.vendor_name
from (SELECT product_code,
COUNT(CASE WHEN inventory_status = 0 THEN 1 END) AS available_count,
COUNT(CASE WHEN inventory_status = 1 THEN 1 END) AS reserved_count
FROM oms_inventory_info
GROUP BY product_code) t1
left join product_info t2 on t1.product_code = t2.product_code
left join oms_vendor_info t3 on t2.vendor_code = t3.vendor_code
<where>
<if test="productCode != null and productCode != ''">and t1.product_code like concat( #{productCode},'%')</if>
<if test="model != null and model != ''">and t2.model = #{model}</if>
<if test="productName != null and productName != ''">and t2.product_name like concat('%',#{productName},'%')</if>
<if test="vendorName != null and vendorName != ''">and t3.vendor_name like concat('%',#{vendorName},'%')</if>
</where>
</select>
<insert id="insertInventoryInfo" parameterType="InventoryInfo" useGeneratedKeys="true" keyProperty="id">
insert into oms_inventory_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productCode != null">product_code,</if>
<if test="productSn != null">product_sn,</if>
<if test="inventoryStatus != null">inventory_status,</if>
<if test="innerCode != null">inner_code,</if>
<if test="outerCode != null">outer_code,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="innerPrice != null">inner_price,</if>
<if test="outerPrice != null">outer_price,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productCode != null">#{productCode},</if>
<if test="productSn != null">#{productSn},</if>
<if test="inventoryStatus != null">#{inventoryStatus},</if>
<if test="innerCode != null">#{innerCode},</if>
<if test="outerCode != null">#{outerCode},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="innerPrice != null">#{innerPrice},</if>
<if test="outerPrice != null">#{outerPrice},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="saveBatch">
insert into oms_inventory_info (product_code, product_sn, inventory_status, inner_code, outer_code, warehouse_id, inner_price, outer_price, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.productCode}, #{item.productSn}, #{item.inventoryStatus}, #{item.innerCode}, #{item.outerCode}, #{item.warehouseId}, #{item.innerPrice}, #{item.outerPrice}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
ON DUPLICATE KEY UPDATE
inventory_status = VALUES(inventory_status),
outer_code = VALUES(outer_code),
outer_price = VALUES(outer_price),
update_by = VALUES(create_by),
update_time = now()
</insert>
<update id="updateInventoryInfo" parameterType="InventoryInfo">
update oms_inventory_info
<trim prefix="SET" suffixOverrides=",">
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productSn != null">product_sn = #{productSn},</if>
<if test="inventoryStatus != null">inventory_status = #{inventoryStatus},</if>
<if test="innerCode != null">inner_code = #{innerCode},</if>
<if test="outerCode != null">outer_code = #{outerCode},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="innerPrice != null">inner_price = #{innerPrice},</if>
<if test="outerPrice != null">outer_price = #{outerPrice},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInventoryInfoById" parameterType="Long">
delete from oms_inventory_info where id = #{id}
</delete>
<delete id="deleteInventoryInfoByIds" parameterType="String">
delete from oms_inventory_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,105 @@
<?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.sip.mapper.OmsInventoryInnerMapper">
<resultMap type="OmsInventoryInner" id="OmsInventoryInnerResult">
<result property="id" column="id" />
<result property="innerCode" column="inner_code" />
<result property="productCode" column="product_code" />
<result property="quantity" column="quantity" />
<result property="warehouseId" column="warehouse_id" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectOmsInventoryInnerVo">
select t1.id, t1.inner_code, t1.product_code, t1.quantity, t1.warehouse_id, t1.create_by, t1.update_by, t1.create_time, t1.update_time ,t1.vendor_code,
t2.warehouse_name, t3.user_name as create_by_name,
t4.vendor_name
from oms_inventory_inner t1
left join oms_warehouse_info t2 on t1.warehouse_id = t2.id
left join oms_vendor_info t4 on t1.vendor_code = t4.vendor_code
left join sys_user t3 on t1.create_by = t3.user_id
</sql>
<select id="selectOmsInventoryInnerList" parameterType="OmsInventoryInner" resultMap="OmsInventoryInnerResult">
<include refid="selectOmsInventoryInnerVo"/>
<where>
<if test="vendorCode != null and vendorCode != ''"> and t1.vendorr_code = #{vendorCode}</if>
<if test="innerCode != null and innerCode != ''"> and t1.inner_code = #{innerCode}</if>
<if test="productCode != null and productCode != ''"> and t1.product_code = #{productCode}</if>
<if test="quantity != null "> and t1.quantity = #{quantity}</if>
<if test="warehouseId != null "> and t1.warehouse_id = #{warehouseId}</if>
<if test="createBy != null and createBy != ''"> and t1.create_by like concat('%', #{createBy}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and t1.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>
<select id="selectOmsInventoryInnerById" parameterType="Long" resultMap="OmsInventoryInnerResult">
<include refid="selectOmsInventoryInnerVo"/>
where t1.id = #{id}
</select>
<select id="selectMaxOrderCode" resultType="java.lang.Integer">
select ifnull( max(SUBSTR( inner_code FROM LENGTH(#{code})+1 FOR 3 )), 0 )
from oms_inventory_inner
where inner_code like concat(#{code}, '%')
</select>
<insert id="insertOmsInventoryInner" parameterType="OmsInventoryInner" useGeneratedKeys="true" keyProperty="id">
insert into oms_inventory_inner
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="innerCode != null and innerCode != ''">inner_code,</if>
<if test="productCode != null">product_code,</if>
<if test="quantity != null">quantity,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="vendorCode != null">vendor_code,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="innerCode != null and innerCode != ''">#{innerCode},</if>
<if test="productCode != null">#{productCode},</if>
<if test="quantity != null">#{quantity},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="vendorCode != null">#{vendorCode},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateOmsInventoryInner" parameterType="OmsInventoryInner">
update oms_inventory_inner
<trim prefix="SET" suffixOverrides=",">
<if test="innerCode != null and innerCode != ''">inner_code = #{innerCode},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="vendorCode != null">vendor_code=#{vendorCode},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOmsInventoryInnerById" parameterType="Long">
delete from oms_inventory_inner where id = #{id}
</delete>
<delete id="deleteOmsInventoryInnerByIds" parameterType="String">
delete from oms_inventory_inner where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -23,7 +23,7 @@
select t1.id, t1.product_code, t1.product_name, t1.model, t1.description, t1.remark, t1.created_at, t1.updated_at, select t1.id, t1.product_code, t1.product_name, t1.model, t1.description, t1.remark, t1.created_at, t1.updated_at,
t1.deleted_at,t1.value,t1.type,t1.hz_code,t1.catalogue_price,t1.guidance_discount,t1.vendor_code t1.deleted_at,t1.value,t1.type,t1.hz_code,t1.catalogue_price,t1.guidance_discount,t1.vendor_code
,t2.vendor_name ,t2.vendor_name
from product_info t1 left join vendor_info t2 on t1.vendor_code = t2.vendor_code from product_info t1 left join oms_vendor_info t2 on t1.vendor_code = t2.vendor_code
</sql> </sql>
<select id="selectProductInfoList" parameterType="ProductInfo" resultMap="ProductInfoResult"> <select id="selectProductInfoList" parameterType="ProductInfo" resultMap="ProductInfoResult">

View File

@ -20,27 +20,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectVendorInfoVo"> <sql id="selectVendorInfoVo">
select vendor_id, vendor_code, vendor_name, vendor_address, vendor_user, vendor_email, vendor_phone, vendor_status, create_by, update_by, create_time, update_time from vendor_info select t1.vendor_id, t1.vendor_code, t1.vendor_name, t1.vendor_address, t1.vendor_user, t1.vendor_email, t1.vendor_phone, t1.vendor_status
, t1.create_by, t1.update_by, t1.create_time, t1.update_time,t1.warehouse_id
,t2.warehouse_name
from oms_vendor_info t1
left join oms_warehouse_info t2 on t1.warehouse_id = t2.id
</sql> </sql>
<select id="selectVendorInfoList" parameterType="VendorInfo" resultMap="VendorInfoResult"> <select id="selectVendorInfoList" parameterType="VendorInfo" resultMap="VendorInfoResult">
<include refid="selectVendorInfoVo"/> <include refid="selectVendorInfoVo"/>
<where> <where>
<if test="vendorCode != null and vendorCode != ''"> and vendor_code like concat('%', #{vendorCode}, '%')</if> <if test="vendorCode != null and vendorCode != ''"> and t1.vendor_code like concat('%', #{vendorCode}, '%')</if>
<if test="vendorName != null and vendorName != ''"> and vendor_name like concat('%', #{vendorName}, '%')</if> <if test="vendorName != null and vendorName != ''"> and t1.vendor_name like concat('%', #{vendorName}, '%')</if>
<if test="vendorAddress != null and vendorAddress != ''"> and vendor_address like concat('%', #{vendorAddress}, '%')</if> <if test="vendorAddress != null and vendorAddress != ''"> and t1.vendor_address like concat('%', #{vendorAddress}, '%')</if>
<if test="vendorUser != null and vendorUser != ''"> and vendor_user = #{vendorUser}</if> <if test="vendorUser != null and vendorUser != ''"> and t1.vendor_user = #{vendorUser}</if>
<if test="vendorStatus != null and vendorStatus != ''"> and vendor_status = #{vendorStatus}</if> <if test="vendorStatus != null and vendorStatus != ''"> and t1.vendor_status = #{vendorStatus}</if>
<if test="vendorNameList != null and vendorNameList.size>0"> and t1.vendor_name in
<foreach item="item" index="index" collection="vendorNameList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where> </where>
</select> </select>
<select id="selectVendorInfoByVendorId" parameterType="Long" resultMap="VendorInfoResult"> <select id="selectVendorInfoByVendorId" parameterType="Long" resultMap="VendorInfoResult">
<include refid="selectVendorInfoVo"/> <include refid="selectVendorInfoVo"/>
where vendor_id = #{vendorId} where t1.vendor_id = #{vendorId}
</select> </select>
<insert id="insertVendorInfo" parameterType="VendorInfo"> <insert id="insertVendorInfo" parameterType="VendorInfo">
insert into vendor_info insert into oms_vendor_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="vendorId != null">vendor_id,</if> <if test="vendorId != null">vendor_id,</if>
<if test="vendorCode != null and vendorCode != ''">vendor_code,</if> <if test="vendorCode != null and vendorCode != ''">vendor_code,</if>
@ -49,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="vendorUser != null and vendorUser != ''">vendor_user,</if> <if test="vendorUser != null and vendorUser != ''">vendor_user,</if>
<if test="vendorEmail != null">vendor_email,</if> <if test="vendorEmail != null">vendor_email,</if>
<if test="vendorPhone != null and vendorPhone != ''">vendor_phone,</if> <if test="vendorPhone != null and vendorPhone != ''">vendor_phone,</if>
<if test="warehouseId != null and warehouseId!=''">warehouse_id,</if>
<if test="vendorStatus != null">vendor_status,</if> <if test="vendorStatus != null">vendor_status,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@ -63,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="vendorUser != null and vendorUser != ''">#{vendorUser},</if> <if test="vendorUser != null and vendorUser != ''">#{vendorUser},</if>
<if test="vendorEmail != null">#{vendorEmail},</if> <if test="vendorEmail != null">#{vendorEmail},</if>
<if test="vendorPhone != null and vendorPhone != ''">#{vendorPhone},</if> <if test="vendorPhone != null and vendorPhone != ''">#{vendorPhone},</if>
<if test="warehouseId != null and warehouseId!=''"> #{warehouseId},</if>
<if test="vendorStatus != null">#{vendorStatus},</if> <if test="vendorStatus != null">#{vendorStatus},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@ -72,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert> </insert>
<update id="updateVendorInfo" parameterType="VendorInfo"> <update id="updateVendorInfo" parameterType="VendorInfo">
update vendor_info update oms_vendor_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="vendorCode != null and vendorCode != ''">vendor_code = #{vendorCode},</if> <if test="vendorCode != null and vendorCode != ''">vendor_code = #{vendorCode},</if>
<if test="vendorName != null and vendorName != ''">vendor_name = #{vendorName},</if> <if test="vendorName != null and vendorName != ''">vendor_name = #{vendorName},</if>
@ -81,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="vendorEmail != null">vendor_email = #{vendorEmail},</if> <if test="vendorEmail != null">vendor_email = #{vendorEmail},</if>
<if test="vendorPhone != null and vendorPhone != ''">vendor_phone = #{vendorPhone},</if> <if test="vendorPhone != null and vendorPhone != ''">vendor_phone = #{vendorPhone},</if>
<if test="vendorStatus != null">vendor_status = #{vendorStatus},</if> <if test="vendorStatus != null">vendor_status = #{vendorStatus},</if>
<if test="warehouseId != null and warehouseId!=''">warehouse_id = #{warehouseId},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
@ -90,11 +102,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteVendorInfoByVendorId" parameterType="Long"> <delete id="deleteVendorInfoByVendorId" parameterType="Long">
delete from vendor_info where vendor_id = #{vendorId} delete from oms_vendor_info where vendor_id = #{vendorId}
</delete> </delete>
<delete id="deleteVendorInfoByVendorIds" parameterType="String"> <delete id="deleteVendorInfoByVendorIds" parameterType="String">
delete from vendor_info where vendor_id in delete from oms_vendor_info where vendor_id in
<foreach item="vendorId" collection="array" open="(" separator="," close=")"> <foreach item="vendorId" collection="array" open="(" separator="," close=")">
#{vendorId} #{vendorId}
</foreach> </foreach>

View File

@ -0,0 +1,122 @@
<?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.sip.mapper.OmsWarehouseInfoMapper">
<resultMap type="OmsWarehouseInfo" id="OmsWarehouseInfoResult">
<result property="id" column="id" />
<result property="warehouseName" column="warehouse_name" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseType" column="warehouse_type" />
<result property="warehouseStatus" column="warehouse_status" />
<result property="address" column="address" />
<result property="managerName" column="manager_name" />
<result property="managerPhone" column="manager_phone" />
<result property="managerEmail" column="manager_email" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectOmsWarehouseInfoVo">
select id, warehouse_name, warehouse_code, warehouse_type, warehouse_status, address, manager_name, manager_phone, manager_email, remark, create_by, create_time, update_by, update_time from oms_warehouse_info
</sql>
<select id="selectOmsWarehouseInfoList" parameterType="OmsWarehouseInfo" resultMap="OmsWarehouseInfoResult">
<include refid="selectOmsWarehouseInfoVo"/>
<where>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if>
<if test="warehouseStatus != null and warehouseStatus != ''"> and warehouse_status = #{warehouseStatus}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="managerName != null and managerName != ''"> and manager_name like concat('%', #{managerName}, '%')</if>
<if test="managerPhone != null and managerPhone != ''"> and manager_phone = #{managerPhone}</if>
<if test="managerEmail != null and managerEmail != ''"> and manager_email = #{managerEmail}</if>
</where>
</select>
<select id="selectOmsWarehouseInfoById" parameterType="Long" resultMap="OmsWarehouseInfoResult">
<include refid="selectOmsWarehouseInfoVo"/>
where id = #{id}
</select>
<select id="listByNameList" resultType="com.ruoyi.sip.domain.OmsWarehouseInfo">
<include refid="selectOmsWarehouseInfoVo"/>
where warehouse_name in
<foreach item="item" collection="list" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<insert id="insertOmsWarehouseInfo" parameterType="OmsWarehouseInfo">
insert into oms_warehouse_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="warehouseName != null">warehouse_name,</if>
<if test="warehouseCode != null">warehouse_code,</if>
<if test="warehouseType != null">warehouse_type,</if>
<if test="warehouseStatus != null">warehouse_status,</if>
<if test="address != null">address,</if>
<if test="managerName != null">manager_name,</if>
<if test="managerPhone != null">manager_phone,</if>
<if test="managerEmail != null">manager_email,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="warehouseName != null">#{warehouseName},</if>
<if test="warehouseCode != null">#{warehouseCode},</if>
<if test="warehouseType != null">#{warehouseType},</if>
<if test="warehouseStatus != null">#{warehouseStatus},</if>
<if test="address != null">#{address},</if>
<if test="managerName != null">#{managerName},</if>
<if test="managerPhone != null">#{managerPhone},</if>
<if test="managerEmail != null">#{managerEmail},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateOmsWarehouseInfo" parameterType="OmsWarehouseInfo">
update oms_warehouse_info
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
<if test="warehouseType != null">warehouse_type = #{warehouseType},</if>
<if test="warehouseStatus != null">warehouse_status = #{warehouseStatus},</if>
<if test="address != null">address = #{address},</if>
<if test="managerName != null">manager_name = #{managerName},</if>
<if test="managerPhone != null">manager_phone = #{managerPhone},</if>
<if test="managerEmail != null">manager_email = #{managerEmail},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOmsWarehouseInfoById" parameterType="Long">
delete from oms_warehouse_info where id = #{id}
</delete>
<delete id="deleteOmsWarehouseInfoByIds" parameterType="String">
delete from oms_warehouse_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>