feat(inventory): 添加库存权限控制功能

- 新增 IInventoryAuthService 接口及实现类,用于获取当前用户权限范围内的制造商、产品编码和仓库信息
- 在 InventoryDelivery 和 InventoryInfo 类中添加 productCodeList 字段,用于存储权限范围内的产品编码列表
- 修改 InventoryDeliveryController 和 InventoryExecutionController,增加权限控制逻辑
- 更新相关模板文件,调整UI布局和显示逻辑以适应新功能
dev_1.0.0
chenhao 2025-08-15 09:08:33 +08:00
parent 0aa2f518fc
commit 258ee495b1
75 changed files with 1224 additions and 357 deletions

View File

@ -152,8 +152,12 @@ process:
orderApproveOffline: orderApproveOffline:
beanName: projectOrderInfoServiceImpl beanName: projectOrderInfoServiceImpl
unis: unis:
inventory:
allAuthRole: 103
order: order:
# 执行单截止时间 # 执行单截止时间
endHour: 96 endHour: 96
mail: mail:
enabled: true enabled: true
# 商务角色id
businessRoleId: 103

View File

@ -358,42 +358,24 @@
<span>生成出库单</span> <span>生成出库单</span>
</div> </div>
<form class="form-horizontal m" id="generateOuterForm"> <form class="form-horizontal m" id="generateOuterForm">
<div class="col-xs-4"> <div class="col-xs-12">
<input type="hidden" name="orderCode" th:value="${projectOrderInfo.orderCode}"> <table>
<div class="form-group"> <tr>
<label class="col-sm-4 control-label ">出库单号:</label> <td>出库单号:</td>
<div class="col-sm-8"> <td><input placeholder="自动生成" id="outerCode" class="form-control" type="text" readonly></td>
<input placeholder="自动生成" id="outerCode" class="form-control" type="text" readonly> <td>出库时间:</td>
</div> <td colspan="3"><input placeholder="自动生成" id="outerTime" class="form-control" type="text"
</div> readonly></td>
</div> </tr>
<div class="col-xs-8"> <tr>
<div class="form-group"> <td>产品编码</td>
<label class="col-sm-4 control-label ">出库时间:</label> <td><input id="outer-productCode" name="productCode" class="form-control" type="text" readonly></td>
<div class="col-sm-8"> <td>产品型号:</td>
<input placeholder="自动生成" id="outerTime" class="form-control" type="text" readonly> <td><input id="outer-model" class="form-control" type="text" readonly></td>
</div> <td>制造商:</td>
</div> <td><input id="outer-vendorName" class="form-control" type="text" readonly></td>
</div> </tr>
<div class="col-xs-4"> </table>
<div class="form-group">
<label class="col-sm-4 control-label">产品编码:</label>
<div class="col-sm-8">
<input id="outer-productCode" name="productCode" class="form-control" type="text" readonly>
</div>
</div>
</div>
<div class="col-xs-4">
<label class="col-sm-4 control-label">产品型号:</label>
<div class="col-sm-8">
<input id="outer-model" class="form-control" type="text" readonly>
</div>
</div>
<div class="col-xs-4">
<label class="col-sm-4 control-label">制造商:</label>
<div class="col-sm-8">
<input id="outer-vendorName" class="form-control" type="text" readonly>
</div>
</div> </div>
<div class="col-xs-12 section-title" > <div class="col-xs-12 section-title" >
<span>仓库信息</span> <span>仓库信息</span>

View File

@ -118,7 +118,9 @@
</form> </form>
</div> </div>
<input id="uploadInput" type="file" accept=".xls,.xlsx,.zip,.rar" style="display: none">
<input type="hidden" id="orderId">
<input type="hidden" id="versionCode">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table> <table id="bootstrap-table"></table>
</div> </div>
@ -155,6 +157,58 @@
$.modal.openFull("项目详情", ctx + "sip/project/view/" + id) $.modal.openFull("项目详情", ctx + "sip/project/view/" + id)
} }
function signOrder(orderId,versionCode) {
$('#orderId').val(orderId)
$('#versionCode').val(versionCode)
$('#uploadInput').click()
}
document.getElementById('uploadInput').addEventListener('change', function (event) {
const file = event.target.files[0];
let data = new FormData()
data.append('file', file)
data.append('orderId', $('#orderId').val())
data.append('versionCode', $('#versionCode').val())
var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
xhr.open('POST', prefix + '/sign', true); // 设置请求类型和URL
// 当请求完成时执行的回调函数
xhr.onload = function (res) {
let data = JSON.parse(res.currentTarget.response)
if (data.code === 0) {
$.modal.msgSuccess('上传成功');
$.table.refresh()
} 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);
});
function downloadSign(id,versionCode){
window.location.href = prefix + `/sign/download?orderId=` + encodeURI(id) + '&versionCode=' + encodeURI(versionCode);
}
$(function () { $(function () {
// $('#content').load(ctx + 'project/order/add'); // $('#content').load(ctx + 'project/order/add');
var urlChina = '/cnarea/select'; var urlChina = '/cnarea/select';
@ -255,9 +309,14 @@
width: 200, width: 200,
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="viewDetail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> '); if (row.signStatus == '0' && row.deliveryStatus=='2') {
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>'); actions.push(`<a class="btn btn-default btn-xs" href="javascript:void(0)" onclick="signOrder('${row.id}','${row.versionCode}')"><i class="fa fa-archive"></i>签收</a>`);
}
if (row.signStatus == '1'){
actions.push(`<a class="btn btn-default btn-xs" href="javascript:void(0)" onclick="downloadSign('${row.id}','${row.versionCode}')"><i class="fa fa-file"></i>签收文件</a>`);
}
return actions.join(''); return actions.join('');
} }
}] }]
@ -304,6 +363,7 @@
}); });
}) })
}); });
</script> </script>
</body> </body>

View File

@ -35,20 +35,20 @@
</form> </form>
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="inventory:info:add"> <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="inventory:info:add">-->
<i class="fa fa-plus"></i> 添加 <!-- <i class="fa fa-plus"></i> 添加-->
</a> <!-- </a>-->
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="inventory:info:edit"> <!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="inventory:info:edit">-->
<i class="fa fa-edit"></i> 修改 <!-- <i class="fa fa-edit"></i> 修改-->
</a> <!-- </a>-->
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="inventory:info:remove"> <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="inventory:info:remove">-->
<i class="fa fa-remove"></i> 删除 <!-- <i class="fa fa-remove"></i> 删除-->
</a> <!-- </a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="inventory:info:export"> <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="inventory:info:export">-->
<i class="fa fa-download"></i> 导出 <!-- <i class="fa fa-download"></i> 导出-->
</a> <!-- </a>-->
</div> <!-- </div>-->
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table> <table id="bootstrap-table"></table>
</div> </div>
@ -117,7 +117,7 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; 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-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>'); actions.push(`<a class="btn btn-default btn-xs " href="javascript:void(0)" onclick="showOuterLog('${row.productCode}')"><i class="fa fa-edit"></i>出库记录</a>`);
return actions.join(''); return actions.join('');
} }
}] }]
@ -129,6 +129,10 @@
var url = prefix + "/innerLog/" + productCode; var url = prefix + "/innerLog/" + productCode;
$.modal.openFull("入库记录表", url); $.modal.openFull("入库记录表", url);
} }
function showOuterLog(productCode){
var url = prefix + "/outerLog/" + productCode;
$.modal.openFull("入库记录表", url);
}
</script> </script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,91 @@
<!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/outer";
function viewDetail(id) {
$.modal.openFull("订单详情", ctx + "project/order/view/"+id)
}
$(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: 'outerCode',
title: '出库单号'
},
{
field: 'orderCode',
title: '合同编号',
formatter: function (value, row, index) {
return `<a href="javascript:viewDetail('${row.orderId}')">${row.orderCode}</a>`;
}
},
{
field: 'projectName',
title: '项目名称'
},
{
field: 'quantity',
title: '数量'
},
{
field: 'outerStatus',
title: '出库状态',
formatter: function (value, row, index) {
return $.table.selectDictLabel([[${@dict.getType('outer_outer_status')}]], value);
}
},
{
field: 'warehouseName',
title: '出库仓'
},
{
field: 'createByName',
title: '经办人'
},
{
field: 'createTime',
title: '出库时间'
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -27,8 +27,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-5 control-label is-required">制造商:</label> <label class="col-sm-5 control-label is-required">制造商:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input name="vendorCode" class="form-control" type="hidden" > <select name="vendorCode" class="form-control" th:with="type=${vendorList}">
<input name="vendorName" class="form-control" type="text" readonly required placeholder="自动带入"> <option th:each="dict : ${type}" th:text="${dict.vendorName}"
th:value="${dict.vendorCode}" ></option>
</select>
</div> </div>
</div> </div>
</div> </div>
@ -50,7 +52,7 @@
</a> </a>
<a class="btn btn-warning" onclick="importList()"> <a class="btn btn-warning" onclick="importList()">
导入模板 导入
</a> </a>
</div> </div>
<div class="btn-group-sm"> <div class="btn-group-sm">
@ -353,7 +355,7 @@ debugger
$(function () { $(function () {
initTable() initTable()
getCurrentVendor() // getCurrentVendor()
$('.fixed-table-toolbar').css('display', 'none') $('.fixed-table-toolbar').css('display', 'none')
}) })

View File

@ -24,7 +24,7 @@
</li> </li>
<li> <li>
<label>经办人:</label> <label>经办人:</label>
<input type="text" name="createBy"/> <input type="text" name="createByName"/>
</li> </li>
<li class="select-time"> <li class="select-time">
<label>入库时间:</label> <label>入库时间:</label>

View File

@ -26,7 +26,18 @@
font-family: "微软雅黑", Arial, sans-serif; /* 统一字体 */ font-family: "微软雅黑", Arial, sans-serif; /* 统一字体 */
justify-content: flex-end; justify-content: flex-end;
} }
table {
border-collapse: collapse;
width: 100%;
margin-bottom: 20px;
}
body {
font-family: "微软雅黑", Arial, sans-serif;
}
th, td {
border: 1px solid #ccc;
padding: 8px;
}
.required-delivery-time { .required-delivery-time {
font-size: 20px; font-size: 20px;
} }
@ -98,66 +109,45 @@
</div> </div>
<form class="form-horizontal m" id="generateDeliveryForm"> <form class="form-horizontal m" id="generateDeliveryForm">
<div class="col-xs-4"> <div class="col-xs-12">
<div class="form-group"> <table>
<label class="col-sm-4 control-label">物流单号:</label> <tr>
<div class="col-sm-8"> <td>物流单号:</td>
<input id="logisticsCode" name="logisticsCode" class="form-control" type="text"> <td> <input id="logisticsCode" name="logisticsCode" class="form-control" type="text"></td>
</div> <td> 发货方式:</td>
</div> <td> <select name="deliveryType" id="deliveryType" class="form-control"
</div> th:with="type=${@dict.getType('delivery_type')}"
<div class="col-xs-4"> required>
<div class="form-group">
<label class="col-sm-4 control-label">发货方式:</label>
<div class="col-sm-8">
<select name="deliveryType" id="deliveryType" class="form-control"
th:with="type=${@dict.getType('delivery_type')}"
required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option> th:value="${dict.dictValue}"></option>
</select> </select></td>
</div> <td>物流公司:</td>
</div> <td> <select name="logisticsCompany" id="logisticsCompany" class="form-control"
</div> th:with="type=${@dict.getType('logistics_company')}">
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-4 control-label">物流公司:</label>
<div class="col-sm-8">
<select name="logisticsCompany" id="logisticsCompany" class="form-control"
th:with="type=${@dict.getType('logistics_company')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option> th:value="${dict.dictValue}"></option>
</select> </select></td>
</div> </tr>
</div> <tr>
</div> <td> 发货人</td>
<div class="col-xs-4"> <td> <input placeholder="自动生成" id="createByName" class="form-control" type="text" readonly></td>
<div class="form-group"> <td>发货时间:</td>
<label class="col-sm-4 control-label ">发货人:</label> <td> <select class="form-control" id="deliveryTimeType" name="deliveryTimeType"
<div class="col-sm-8"> onchange="changeDeliveryTimeType()">
<input placeholder="自动生成" id="createByName" class="form-control" type="text" readonly>
</div>
</div>
</div>
<div class="col-xs-8">
<div class="form-group">
<label class="col-sm-3 control-label ">实际发货时间:</label>
<div class="col-sm-3">
<select class="form-control" id="deliveryTimeType" name="deliveryTimeType"
onchange="changeDeliveryTimeType()">
<option value="0">立即发货</option> <option value="0">立即发货</option>
<option value="1">自定义</option> <option value="1">自定义</option>
</select> </select></td>
</div> <td colspan="2"> <input name="deliveryTime" class="time-input form-control" id="deliveryTime" autocomplete="off"
<div class="col-sm-6"> placeholder="要求发货时间"/></td>
<input name="deliveryTime" class="time-input form-control" id="deliveryTime" autocomplete="off" </tr>
placeholder="要求发货时间"/>
</div> </table>
</div>
</div> </div>
</form> </form>
<form id="query-product-sn"> <form id="query-product-sn">
<input type="hidden" name="inventoryStatus" value="0"> <input type="hidden" name="inventoryStatus" value="0">
<input type="hidden" name="productCode">
<input type="hidden" id="outCode" name="outerCode"> <input type="hidden" id="outCode" name="outerCode">
<input type="hidden" name="warehouseId"> <input type="hidden" name="warehouseId">
</form> </form>
@ -177,6 +167,7 @@
<th:block th:include="include :: footer"/> <th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/> <th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript"> <script th:inline="javascript">
var showExcelFlag = [[${@permission.hasPermi('inventory:outer:importExcel')}]];
var prefix = ctx + "inventory/outer"; var prefix = ctx + "inventory/outer";
var productPrefix = ctx + "inventory/info"; var productPrefix = ctx + "inventory/info";
var deliveryPrefix = ctx + "inventory/delivery"; var deliveryPrefix = ctx + "inventory/delivery";
@ -205,6 +196,7 @@
const file = event.target.files[0]; const file = event.target.files[0];
let data = new FormData() let data = new FormData()
data.append('file', file) data.append('file', file)
data.append('productCode', $('[name="productCode"]').val())
var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象 var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
xhr.open('POST', prefix + '/importData', true); // 设置请求类型和URL xhr.open('POST', prefix + '/importData', true); // 设置请求类型和URL
// 当请求完成时执行的回调函数 // 当请求完成时执行的回调函数
@ -212,7 +204,7 @@
let data = JSON.parse(res.currentTarget.response) let data = JSON.parse(res.currentTarget.response)
if (data.code === 0) { if (data.code === 0) {
$.modal.msgSuccess('上传成功'); $.modal.msgSuccess('上传成功');
$.table.refreshOptions({data: data}) $.table.search('query-product-sn', 'bootstrap-table')
} else { } else {
top.layer.alert(data.msg || '导入失败', { top.layer.alert(data.msg || '导入失败', {
icon: 2, icon: 2,
@ -251,6 +243,7 @@
autoclose: true autoclose: true
}); });
$(function () { $(function () {
$('#toolbar').addClass( showExcelFlag )
if (showReturnFlag) { if (showReturnFlag) {
parent.$('.layui-layer-btn0').css('display', 'none') parent.$('.layui-layer-btn0').css('display', 'none')
} else { } else {
@ -405,7 +398,7 @@
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
let disabled = Number(row.quantity) <= Number(row.deliveryGenerateQuantity) + Number(row.deliveryConfirmQuantity) let disabled = Number(row.quantity) <= Number(row.deliveryGenerateQuantity) + Number(row.deliveryConfirmQuantity)
actions.push(`<span class="btn btn-default btn-xs " href="javascript:void(0)" ${disabled ? 'style="pointer-events: none;" disabled' : ''} onclick="checkDelivery(\'${row.quantity}\',\'${row.warehouseId}\')">发货</span>`); actions.push(`<span class="btn btn-default btn-xs " href="javascript:void(0)" ${disabled ? 'style="pointer-events: none;" disabled' : ''} onclick="checkDelivery(\'${row.quantity}\',\'${row.warehouseId}\','${row.productCode}')">发货</span>`);
return actions.join(''); return actions.join('');
} }
}] }]
@ -413,13 +406,14 @@
$.table.init(options); $.table.init(options);
} }
function checkDelivery(quantity, warehouseId) { function checkDelivery(quantity, warehouseId, productCode) {
initModal() initModal()
// $.table.set('bootstrap-table') // $.table.set('bootstrap-table')
let width = 1000, height = 700 let width = 1000, height = 700
parent.$('.layui-layer-btn').css('display', 'none') parent.$('.layui-layer-btn').css('display', 'none')
parent.$('.layui-layer-setwin').css('display', 'none') parent.$('.layui-layer-setwin').css('display', 'none')
$('[name="warehouseId"]').val(warehouseId) $('[name="warehouseId"]').val(warehouseId)
$('[name="productCode"]').val(productCode)
$('[name="inventoryStatus"]').val(0) $('[name="inventoryStatus"]').val(0)
$('#query-product-sn [name="outerCode"]').val('') $('#query-product-sn [name="outerCode"]').val('')
$.table.search('query-product-sn', 'bootstrap-table') $.table.search('query-product-sn', 'bootstrap-table')
@ -552,7 +546,7 @@
var actions = []; var actions = [];
if (row.deliveryStatus === '0') { if (row.deliveryStatus === '0') {
actions.push('<span class="btn btn-danger btn-xs " style="margin:0px 5px" href="javascript:void(0)" onclick="deleteDelivery(' + row.id + ')">撤销</span>'); actions.push('<span class="btn btn-danger btn-xs " style="margin:0px 5px" href="javascript:void(0)" onclick="deleteDelivery(' + row.id + ')">撤销</span>');
actions.push(`<span class="btn btn-default btn-xs " href="javascript:void(0)" onclick="updateStatus(' ${row.id} ','${row.outerCode}','${row.orderCode}')">确认发货</span>`); actions.push(`<span class="btn btn-default btn-xs " href="javascript:void(0)" onclick="updateStatus(' ${row.id} ','${row.outerCode}','${row.orderCode}','${row.productCode}')">确认发货</span>`);
} else { } else {
@ -624,8 +618,8 @@
}) })
} }
function updateStatus(id, outerCode, orderCode) { function updateStatus(id, outerCode, orderCode,productCode) {
$.operate.post(deliveryPrefix + '/status', {id: id, outerCode: outerCode, orderCode: orderCode}, res => { $.operate.post(deliveryPrefix + '/status', {id: id, outerCode: outerCode, orderCode: orderCode,productCode:productCode}, res => {
refreshTable(); refreshTable();
}) })

View File

@ -140,7 +140,7 @@
function received(id) { function received(id) {
$.modal.confirm("确认要确认接收吗?", function () { $.modal.confirm("确认要确认接收吗?", function () {
$.operate.post(prefix + "/status", {"id": id, "outerStatus": '3'},()=>{ $.operate.post(prefix + "/status", {"id": id, "outerStatus": '3'},()=>{
$.table.search() // $.table.search()
}); });
}) })
} }
@ -148,7 +148,7 @@
function refundable(id) { function refundable(id) {
$.modal.confirm("确认要确认退回吗?", function () { $.modal.confirm("确认要确认退回吗?", function () {
$.operate.post(prefix + "/status", {"id": id, "outerStatus": '4'},()=>{ $.operate.post(prefix + "/status", {"id": id, "outerStatus": '4'},()=>{
$.table.search() // $.table.search()
}); });
}) })
} }

View File

@ -623,12 +623,7 @@
s:[{ s:[{
n: '电子订单', n: '电子订单',
v: '0' v: '0'
}, }]
{
n: '纸质合同',
v: '1'
}]
}, },
{ {
n: '定制开发合同', n: '定制开发合同',

View File

@ -56,12 +56,13 @@
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">详细地址</label> <label class="col-sm-4 control-label is-required">邮件</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="address" class="form-control" type="text"> <input name="contactEmail" class="form-control" type="text">
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">联系人:</label> <label class="col-sm-4 control-label">联系人:</label>
@ -78,7 +79,14 @@
</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">
<input name="address" class="form-control" type="text">
</div>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />

View File

@ -58,12 +58,13 @@
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">详细地址</label> <label class="col-sm-4 control-label is-required">邮件</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="address" th:field="*{address}" class="form-control" type="text"> <input name="contactEmail" th:field="*{contactEmail}" class="form-control" type="text">
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">联系人:</label> <label class="col-sm-4 control-label">联系人:</label>
@ -80,7 +81,14 @@
</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">
<input name="address" th:field="*{address}" class="form-control" type="text">
</div>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />

View File

@ -16,6 +16,9 @@
.bootstrap-table table { .bootstrap-table table {
table-layout: fixed; table-layout: fixed;
} }
.word-warp{
word-break: break-all;
}
</style> </style>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
@ -142,6 +145,12 @@
width:100, width:100,
field: 'contactPhone', field: 'contactPhone',
title: '联系电话' title: '联系电话'
},
{
width:100,
class:'word-warp',
field: 'contactEmail',
title: '邮件'
}, },
{ {
width:100, width:100,

View File

@ -14,14 +14,7 @@
</div> </div>
</div> </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="col-xs-12">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">类型:</label> <label class="col-sm-3 control-label is-required">类型:</label>

View File

@ -23,16 +23,6 @@
</div> </div>
</div> </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="col-xs-12">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">状态:</label> <label class="col-sm-3 control-label is-required">状态:</label>

View File

@ -19,10 +19,7 @@
<label>仓库名称:</label> <label>仓库名称:</label>
<input type="text" name="warehouseName"/> <input type="text" name="warehouseName"/>
</li> </li>
<li>
<label>仓库编码:</label>
<input type="text" name="warehouseCode"/>
</li>
<li> <li>
<label>类型:</label> <label>类型:</label>
<select name="warehouseType" th:with="type=${@dict.getType('warehouse_type')}"> <select name="warehouseType" th:with="type=${@dict.getType('warehouse_type')}">
@ -105,10 +102,6 @@
field: 'warehouseName', field: 'warehouseName',
title: '仓库名称' title: '仓库名称'
}, },
{
field: 'warehouseCode',
title: '仓库编码'
},
{ {
field: 'warehouseType', field: 'warehouseType',
title: '类型', title: '类型',

View File

@ -1,6 +1,10 @@
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.service.IInventoryAuthService;
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;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -29,6 +33,8 @@ public class InventoryDeliveryController extends BaseController
@Autowired @Autowired
private IInventoryDeliveryService inventoryDeliveryService; private IInventoryDeliveryService inventoryDeliveryService;
@Autowired
private IInventoryAuthService inventoryAuthService;
@RequiresPermissions("inventory:delivery:view") @RequiresPermissions("inventory:delivery:view")
@GetMapping() @GetMapping()
@ -45,8 +51,16 @@ public class InventoryDeliveryController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(InventoryDelivery inventoryDelivery) public TableDataInfo list(InventoryDelivery inventoryDelivery)
{ {
startPage();
inventoryDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.CONFIRM_DELIVERY.getCode()); inventoryDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.CONFIRM_DELIVERY.getCode());
if (!inventoryAuthService.authAll()) {
List<String> productCodeList = inventoryAuthService.authProductCode();
if (CollUtil.isEmpty(productCodeList)) {
return getDataTable(Collections.emptyList());
}
inventoryDelivery.setProductCodeList(productCodeList);
}
startPage();
List<InventoryDelivery> list = inventoryDeliveryService.selectInventoryDeliveryList(inventoryDelivery); List<InventoryDelivery> list = inventoryDeliveryService.selectInventoryDeliveryList(inventoryDelivery);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -41,6 +41,8 @@ public class InventoryExecutionController extends BaseController {
private IProjectOrderInfoService orderInfoService; private IProjectOrderInfoService orderInfoService;
@Autowired @Autowired
private IExecutionTrackService service; private IExecutionTrackService service;
@Autowired
private IInventoryAuthService inventoryAuthService;
@RequiresPermissions("inventory:inner:view") @RequiresPermissions("inventory:inner:view")
@GetMapping() @GetMapping()
@ -52,8 +54,17 @@ public class InventoryExecutionController extends BaseController {
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(ProjectOrderInfo projectOrderInfo) { public TableDataInfo list(ProjectOrderInfo projectOrderInfo) {
startPage();
projectOrderInfo.setOrderStatus(ProjectOrderInfo.OrderStatus.APPROVE_COMPLETE.getCode()); projectOrderInfo.setOrderStatus(ProjectOrderInfo.OrderStatus.APPROVE_COMPLETE.getCode());
if (!inventoryAuthService.authAll()) {
List<String> productCodeList = inventoryAuthService.authProductCode();
if (CollUtil.isEmpty(productCodeList)) {
return getDataTable(Collections.emptyList());
}
projectOrderInfo.setProductCodeList(productCodeList);
}
startPage();
List<ProjectOrderInfo> list = orderInfoService.selectProjectOrderInfoList(projectOrderInfo); List<ProjectOrderInfo> list = orderInfoService.selectProjectOrderInfoList(projectOrderInfo);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -8,6 +8,7 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.sip.domain.ProductInfo; import com.ruoyi.sip.domain.ProductInfo;
import com.ruoyi.sip.domain.ProjectInfo; import com.ruoyi.sip.domain.ProjectInfo;
import com.ruoyi.sip.domain.VendorInfo; import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IProductInfoService; import com.ruoyi.sip.service.IProductInfoService;
import com.ruoyi.sip.service.IVendorInfoService; import com.ruoyi.sip.service.IVendorInfoService;
import liquibase.pro.packaged.A; import liquibase.pro.packaged.A;
@ -46,7 +47,7 @@ public class InventoryInfoController extends BaseController
@Autowired @Autowired
private IProductInfoService productInfoService; private IProductInfoService productInfoService;
@Autowired @Autowired
private IVendorInfoService vendorInfoService; private IInventoryAuthService inventoryAuthService;
@RequiresPermissions("inventory:info:view") @RequiresPermissions("inventory:info:view")
@GetMapping() @GetMapping()
@ -63,6 +64,14 @@ public class InventoryInfoController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(InventoryInfo inventoryInfo) public TableDataInfo list(InventoryInfo inventoryInfo)
{ {
if (!inventoryAuthService.authAll()) {
List<String> productCodeList = inventoryAuthService.authProductCode();
if (CollUtil.isEmpty(productCodeList)) {
return getDataTable(Collections.emptyList());
}
inventoryInfo.setProductCodeList(productCodeList);
}
startPage(); startPage();
List<InventoryInfo> list = inventoryInfoService.selectInventoryInfoList(inventoryInfo); List<InventoryInfo> list = inventoryInfoService.selectInventoryInfoList(inventoryInfo);
return getDataTable(list); return getDataTable(list);
@ -71,14 +80,15 @@ public class InventoryInfoController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo groupList(ProductInfo info) public TableDataInfo groupList(ProductInfo info)
{ {
if (!inventoryAuthService.authAll()) {
List<String> productCodeList = inventoryAuthService.authProductCode();
if (CollUtil.isEmpty(productCodeList)) {
return getDataTable(Collections.emptyList());
}
info.setProductCodeList(productCodeList);
}
startPage(); startPage();
// List<VendorInfo> current = vendorInfoService.current();
// if (CollUtil.isEmpty(current)) {
// return getDataTable(Collections.emptyList());
// }
// if (!ShiroUtils.getSysUser().isAdmin()) {
// info.setVendorCode(current.get(0).getVendorCode());
// }
List<ProductInfo> list = productInfoService.selectProductInfoList(info); List<ProductInfo> list = productInfoService.selectProductInfoList(info);
return getDataTable(list); return getDataTable(list);
} }
@ -104,6 +114,7 @@ public class InventoryInfoController extends BaseController
@GetMapping("/add") @GetMapping("/add")
public String add() public String add()
{ {
return prefix + "/add"; return prefix + "/add";
} }
@ -143,11 +154,18 @@ public class InventoryInfoController extends BaseController
return toAjax(inventoryInfoService.updateInventoryInfo(inventoryInfo)); return toAjax(inventoryInfoService.updateInventoryInfo(inventoryInfo));
} }
@GetMapping("/innerLog/{productCode}") @GetMapping("/innerLog/{productCode}")
public String view(@PathVariable("productCode") String productCode, ModelMap mmap) { public String innerLog(@PathVariable("productCode") String productCode, ModelMap mmap) {
mmap.put("productCode", productCode); mmap.put("productCode", productCode);
return prefix + "/innerLog"; return prefix + "/innerLog";
} }
@GetMapping("/outerLog/{productCode}")
public String outerLog(@PathVariable("productCode") String productCode, ModelMap mmap) {
mmap.put("productCode", productCode);
return prefix + "/outerLog";
}
/** /**
* *
*/ */

View File

@ -1,23 +1,27 @@
package com.ruoyi.sip.controller; package com.ruoyi.sip.controller;
import java.util.Arrays; import java.io.IOException;
import java.util.HashMap; import java.io.InputStream;
import java.util.List; import java.util.*;
import java.util.Map;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.sip.domain.OmsInventoryInner;
import com.ruoyi.sip.domain.ProjectOrderFileLog;
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto; import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IOmsInventoryInnerService;
import com.ruoyi.sip.vo.OuterDeliveryVo; import com.ruoyi.sip.vo.OuterDeliveryVo;
import liquibase.pro.packaged.A; import liquibase.pro.packaged.A;
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;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.InventoryOuter; import com.ruoyi.sip.domain.InventoryOuter;
@ -26,6 +30,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* Controller * Controller
@ -41,6 +46,10 @@ public class InventoryOuterController extends BaseController
@Autowired @Autowired
private IInventoryOuterService inventoryOuterService; private IInventoryOuterService inventoryOuterService;
@Autowired
private IOmsInventoryInnerService innerService;
@Autowired
private IInventoryAuthService inventoryAuthService;
@RequiresPermissions("inventory:outer:view") @RequiresPermissions("inventory:outer:view")
@GetMapping() @GetMapping()
@ -57,8 +66,16 @@ public class InventoryOuterController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(InventoryOuter inventoryOuter) public TableDataInfo list(InventoryOuter inventoryOuter)
{ {
startPage();
inventoryOuter.setOuterStatusList(Arrays.asList(InventoryOuter.OuterStatusEnum.WAIT_RECEIVE.getCode(), InventoryOuter.OuterStatusEnum.RECEIVED.getCode())); inventoryOuter.setOuterStatusList(Arrays.asList(InventoryOuter.OuterStatusEnum.WAIT_RECEIVE.getCode(), InventoryOuter.OuterStatusEnum.RECEIVED.getCode()));
if (!inventoryAuthService.authAll()){
List<String> productCodeList = inventoryAuthService.authProductCode();
if (CollUtil.isEmpty(productCodeList)){
return getDataTable(Collections.emptyList());
}
inventoryOuter.setProductCodeList(productCodeList);
}
startPage();
List<InventoryOuter> list = inventoryOuterService.selectInventoryOuterList(inventoryOuter); List<InventoryOuter> list = inventoryOuterService.selectInventoryOuterList(inventoryOuter);
return getDataTable(list); return getDataTable(list);
} }
@ -138,6 +155,29 @@ public class InventoryOuterController extends BaseController
return util.importTemplateExcel("发货数据"); return util.importTemplateExcel("发货数据");
} }
@PostMapping("/importData")
@ResponseBody
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode) {
ExcelUtil<InventoryInfoExcelDto> util = new ExcelUtil<InventoryInfoExcelDto>(InventoryInfoExcelDto.class);
try (InputStream inputStream = file.getInputStream()) {
List<InventoryInfoExcelDto> inventoryInfoExcelDtoList = util.importExcel(inputStream);
if (CollUtil.isEmpty(inventoryInfoExcelDtoList)){
return AjaxResult.error("导入数据为空");
}
innerService.importByOuter(inventoryInfoExcelDtoList, productCode);
} catch (IOException e) {
throw new ServiceException("读取excel错误,请联系管理员");
} catch (ServiceException e) {
return AjaxResult.error(e.getMessage());
}
return AjaxResult.success();
}
/** /**
* *
*/ */

View File

@ -4,9 +4,11 @@ import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.sip.domain.InventoryInfo; import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.domain.OmsWarehouseInfo; import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto; import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IInventoryInfoService; import com.ruoyi.sip.service.IInventoryInfoService;
import com.ruoyi.sip.service.IOmsWarehouseInfoService; import com.ruoyi.sip.service.IOmsWarehouseInfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -42,6 +44,8 @@ public class OmsInventoryInnerController extends BaseController {
private IInventoryInfoService inventoryInfoService; private IInventoryInfoService inventoryInfoService;
@Autowired @Autowired
private IOmsWarehouseInfoService warehouseInfoService; private IOmsWarehouseInfoService warehouseInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
@RequiresPermissions("inventory:inner:view") @RequiresPermissions("inventory:inner:view")
@GetMapping() @GetMapping()
@ -80,10 +84,11 @@ public class OmsInventoryInnerController extends BaseController {
@RequiresPermissions("inventory:inner:add") @RequiresPermissions("inventory:inner:add")
@GetMapping("/add") @GetMapping("/add")
public String add(ModelMap modelMap) { public String add(ModelMap modelMap) {
//仓库进行权限校验
OmsWarehouseInfo queryWarehouseParam = new OmsWarehouseInfo(); OmsWarehouseInfo queryWarehouseParam = new OmsWarehouseInfo();
queryWarehouseParam.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue()); queryWarehouseParam.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
modelMap.put("warehouseList", warehouseInfoService.selectOmsWarehouseInfoList(queryWarehouseParam)); modelMap.put("warehouseList", warehouseInfoService.listByAuth(queryWarehouseParam));
modelMap.put("vendorList", inventoryAuthService.currentVendor());
return prefix + "/add"; return prefix + "/add";
} }
@ -152,10 +157,15 @@ public class OmsInventoryInnerController extends BaseController {
} }
@PostMapping("/importData") @PostMapping("/importData")
@ResponseBody @ResponseBody
public TableDataInfo importData(MultipartFile file) throws IOException { public Object importData(MultipartFile file) throws IOException {
ExcelUtil<WarehouseInnerExcelDto> util = new ExcelUtil<WarehouseInnerExcelDto>(WarehouseInnerExcelDto.class); ExcelUtil<WarehouseInnerExcelDto> util = new ExcelUtil<WarehouseInnerExcelDto>(WarehouseInnerExcelDto.class);
List<WarehouseInnerExcelDto> excelList = util.importExcel(file.getInputStream()); List<WarehouseInnerExcelDto> excelList = util.importExcel(file.getInputStream());
List<InventoryInfo> inventoryInfos = inventoryInfoService.fillBaseInfo(excelList); List<InventoryInfo> inventoryInfos = null;
try {
inventoryInfos = inventoryInfoService.fillBaseInfo(excelList);
} catch (ServiceException e) {
return AjaxResult.error(e.getMessage());
}
return getDataTable(inventoryInfos); return getDataTable(inventoryInfos);
} }

View File

@ -50,7 +50,7 @@ public class OmsWarehouseInfoController extends BaseController
public TableDataInfo list(OmsWarehouseInfo omsWarehouseInfo) public TableDataInfo list(OmsWarehouseInfo omsWarehouseInfo)
{ {
startPage(); startPage();
List<OmsWarehouseInfo> list = omsWarehouseInfoService.selectOmsWarehouseInfoList(omsWarehouseInfo); List<OmsWarehouseInfo> list = omsWarehouseInfoService.list(omsWarehouseInfo);
return getDataTable(list); return getDataTable(list);
} }
@ -63,7 +63,7 @@ public class OmsWarehouseInfoController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult export(OmsWarehouseInfo omsWarehouseInfo) public AjaxResult export(OmsWarehouseInfo omsWarehouseInfo)
{ {
List<OmsWarehouseInfo> list = omsWarehouseInfoService.selectOmsWarehouseInfoList(omsWarehouseInfo); List<OmsWarehouseInfo> list = omsWarehouseInfoService.list(omsWarehouseInfo);
ExcelUtil<OmsWarehouseInfo> util = new ExcelUtil<OmsWarehouseInfo>(OmsWarehouseInfo.class); ExcelUtil<OmsWarehouseInfo> util = new ExcelUtil<OmsWarehouseInfo>(OmsWarehouseInfo.class);
return util.exportExcel(list, "仓库基础信息数据"); return util.exportExcel(list, "仓库基础信息数据");
} }

View File

@ -6,6 +6,7 @@ import java.util.List;
import cn.hutool.core.collection.CollUtil; 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.IInventoryAuthService;
import com.ruoyi.sip.service.IVendorInfoService; import com.ruoyi.sip.service.IVendorInfoService;
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;
@ -42,6 +43,8 @@ public class ProductInfoController extends BaseController
@Autowired @Autowired
private IVendorInfoService vendorInfoService; private IVendorInfoService vendorInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
@RequiresPermissions("system:product:view") @RequiresPermissions("system:product:view")
@GetMapping() @GetMapping()
public String product() public String product()
@ -66,6 +69,13 @@ public class ProductInfoController extends BaseController
public AjaxResult queryByCode(@PathVariable("productCode") String productCode) public AjaxResult queryByCode(@PathVariable("productCode") String productCode)
{ {
if (!inventoryAuthService.authAll()){
List<String> authProductCode = inventoryAuthService.authProductCode();
if (!authProductCode.contains(productCode)){
return AjaxResult.error("无产品权限");
}
}
List<ProductInfo> list = productInfoService.selectProductInfoByCodeList(Collections.singletonList(productCode)); List<ProductInfo> list = productInfoService.selectProductInfoByCodeList(Collections.singletonList(productCode));
if (CollUtil.isEmpty(list)){ if (CollUtil.isEmpty(list)){
return AjaxResult.error("未找到该产品"); return AjaxResult.error("未找到该产品");

View File

@ -13,11 +13,13 @@ import java.util.Map;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
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;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.sip.domain.ProjectInfo;
import com.ruoyi.sip.domain.ProjectOrderFileLog; import com.ruoyi.sip.domain.ProjectOrderFileLog;
import com.ruoyi.sip.flowable.domain.Todo; import com.ruoyi.sip.flowable.domain.Todo;
import com.ruoyi.sip.flowable.service.TodoService; import com.ruoyi.sip.flowable.service.TodoService;
@ -299,6 +301,28 @@ public class ProjectOrderInfoController extends BaseController
fileLogService.insertProjectOrderFileLog(projectOrderFileLog); fileLogService.insertProjectOrderFileLog(projectOrderFileLog);
return AjaxResult.success(projectOrderFileLog); return AjaxResult.success(projectOrderFileLog);
} }
@PostMapping("/sign")
@ResponseBody
public AjaxResult sign(@RequestPart("file") MultipartFile file, @RequestParam("orderId") Long orderId,
@RequestParam("versionCode") String versionCode) {
ProjectOrderFileLog projectOrderFileLog = new ProjectOrderFileLog();
projectOrderFileLog.setFileType(ProjectOrderFileLog.FileTypeEnum.SIGN.getCode());
projectOrderFileLog.setOrderId(orderId);
projectOrderFileLog.setUploadTime(DateUtils.getNowDate());
projectOrderFileLog.setUploadUser(ShiroUtils.getUserId().toString());
projectOrderFileLog.setFileName(file.getOriginalFilename());
projectOrderFileLog.setFileSort("0");
projectOrderFileLog.setFileVersionCode(versionCode);
try {
String upload = FileUploadUtils.upload(file);
projectOrderFileLog.setFilePath(upload);
} catch (IOException e) {
return AjaxResult.error("上传失败");
}
projectOrderInfoService.sign(projectOrderFileLog);
return AjaxResult.success(projectOrderFileLog);
}
@PostMapping("/file/remove") @PostMapping("/file/remove")
@ResponseBody @ResponseBody
@ -361,6 +385,29 @@ public class ProjectOrderInfoController extends BaseController
log.error("下载文件失败", e); log.error("下载文件失败", e);
} }
} }
@GetMapping("/sign/download")
public void download(@RequestParam("orderId") Long orderId, @RequestParam("versionCode") String versionCode, HttpServletRequest request, HttpServletResponse response) {
ProjectOrderFileLog fileLog = new ProjectOrderFileLog();
fileLog.setOrderId(orderId);
fileLog.setFileType(ProjectOrderFileLog.FileTypeEnum.SIGN.getCode());
fileLog.setFileVersionCode(versionCode);
List<ProjectOrderFileLog> projectOrderFileLogs = fileLogService.selectProjectOrderFileLogList(fileLog);
if (CollUtil.isEmpty(projectOrderFileLogs)){
throw new ServiceException("文件为空");
}
ProjectOrderFileLog projectOrderFileLog = projectOrderFileLogs.get(0);
try {
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 下载名称
String downloadPath = projectOrderFileLog.getFilePath().replace(Constants.RESOURCE_PREFIX,localPath);
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, StringUtils.isEmpty(projectOrderFileLog.getFileName()) ? projectOrderFileLog.getFilePath() : projectOrderFileLog.getFileName());
FileUtils.writeBytes(downloadPath, response.getOutputStream());
} catch (Exception e) {
log.error("下载文件失败", e);
}
}
@GetMapping("/file/view") @GetMapping("/file/view")
public ResponseEntity<ByteArrayResource> view(@RequestParam("filePath") String filePath, @RequestParam("fileName") String fileName, HttpServletRequest request, HttpServletResponse response) { public ResponseEntity<ByteArrayResource> view(@RequestParam("filePath") String filePath, @RequestParam("fileName") String fileName, HttpServletRequest request, HttpServletResponse response) {

View File

@ -18,6 +18,7 @@ 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.OmsWarehouseInfo;
import com.ruoyi.sip.domain.VendorInfo; import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IOmsWarehouseInfoService; 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;
@ -54,6 +55,8 @@ public class VendorInfoController extends BaseController
private IVendorInfoService vendorInfoService; private IVendorInfoService vendorInfoService;
@Autowired @Autowired
private IOmsWarehouseInfoService warehouseInfoService; private IOmsWarehouseInfoService warehouseInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
@RequiresPermissions("system:vendor:view") @RequiresPermissions("system:vendor:view")
@GetMapping() @GetMapping()
@ -180,7 +183,7 @@ public class VendorInfoController extends BaseController
@GetMapping("/current") @GetMapping("/current")
@ResponseBody @ResponseBody
public AjaxResult current() { public AjaxResult current() {
List<VendorInfo> vendorInfo = vendorInfoService.current(); List<VendorInfo> vendorInfo = inventoryAuthService.currentVendor();
if (CollUtil.isEmpty(vendorInfo)) { if (CollUtil.isEmpty(vendorInfo)) {
return AjaxResult.success(); return AjaxResult.success();
} }

View File

@ -52,6 +52,7 @@ public class InventoryDelivery extends BaseEntity
private String projectName; private String projectName;
@Excel(name = "产品编码") @Excel(name = "产品编码")
private String productCode; private String productCode;
private List<String> productCodeList;
@Excel(name = "产品型号") @Excel(name = "产品型号")
private String model; private String model;
@Excel(name = "发货数量") @Excel(name = "发货数量")

View File

@ -1,6 +1,7 @@
package com.ruoyi.sip.domain; package com.ruoyi.sip.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
import lombok.Data; import lombok.Data;
import lombok.Getter; import lombok.Getter;
@ -28,6 +29,7 @@ public class InventoryInfo extends BaseEntity
/** 产品编码 */ /** 产品编码 */
@Excel(name = "产品编码") @Excel(name = "产品编码")
private String productCode; private String productCode;
private List<String> productCodeList;
private String model; private String model;
private String productDesc; private String productDesc;

View File

@ -31,6 +31,7 @@ public class InventoryOuter extends BaseEntity
/** 出库单号 */ /** 出库单号 */
@Excel(name = "出库单号") @Excel(name = "出库单号")
private String outerCode; private String outerCode;
/** 发货时间 */ /** 发货时间 */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "发货时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "发货时间", width = 30, dateFormat = "yyyy-MM-dd")
@ -40,6 +41,7 @@ public class InventoryOuter extends BaseEntity
/** 订单编码 */ /** 订单编码 */
@Excel(name = "合同编号") @Excel(name = "合同编号")
private String orderCode; private String orderCode;
private String orderId;
@Excel(name = "项目名称") @Excel(name = "项目名称")
private String projectName; private String projectName;
/** 产品BOM编码 */ /** 产品BOM编码 */
@ -72,6 +74,7 @@ public class InventoryOuter extends BaseEntity
/** 联系地址 */ /** 联系地址 */
// @Excel(name = "联系地址") // @Excel(name = "联系地址")
private String contactAddress; private String contactAddress;
private String createByName;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "生成时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "生成时间", width = 30, dateFormat = "yyyy-MM-dd")

View File

@ -41,5 +41,6 @@ public class InventoryOuterDetail extends BaseEntity
private Long availableCount; private Long availableCount;
private String productCode; private String productCode;
private String model; private String model;
private String productName;
} }

View File

@ -1,5 +1,7 @@
package com.ruoyi.sip.domain; package com.ruoyi.sip.domain;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -46,6 +48,7 @@ public class OmsInventoryInner extends BaseEntity {
@Excel(name = "制造商") @Excel(name = "制造商")
private String vendorName; private String vendorName;
private String vendorCode; private String vendorCode;
private String model;
/** /**
* *
@ -56,6 +59,7 @@ public class OmsInventoryInner extends BaseEntity {
private String warehouseName; private String warehouseName;
@Excel(name = "经办人") @Excel(name = "经办人")
private String createByName; private String createByName;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "入库时间",dateFormat="yyyy-MM-dd HH:mm:ss") @Excel(name = "入库时间",dateFormat="yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;

View File

@ -7,6 +7,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
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;
/** /**
* oms_warehouse_info * oms_warehouse_info
* *
@ -20,10 +22,12 @@ public class OmsWarehouseInfo extends BaseEntity
/** */ /** */
private Long id; private Long id;
private List<Long> idList;
/** 仓库名称 */ /** 仓库名称 */
@Excel(name = "仓库名称") @Excel(name = "仓库名称")
private String warehouseName; private String warehouseName;
private List<String> warehouseNameList;
/** 仓库编码 */ /** 仓库编码 */
@Excel(name = "仓库编码") @Excel(name = "仓库编码")

View File

@ -3,8 +3,6 @@ package com.ruoyi.sip.domain;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
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;
@ -54,6 +52,7 @@ public class PartnerInfo extends BaseEntity
@Excel(name = "认证级别") @Excel(name = "认证级别")
private String level; private String level;
private String levelName; private String levelName;
private String contactEmail;
/** */ /** */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")

View File

@ -1,6 +1,8 @@
package com.ruoyi.sip.domain; package com.ruoyi.sip.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -28,6 +30,7 @@ public class ProductInfo extends BaseEntity
/** 产品编码 */ /** 产品编码 */
@Excel(name = "产品编码") @Excel(name = "产品编码")
private String productCode; private String productCode;
private List<String> productCodeList;
@Excel(name = "华智编码") @Excel(name = "华智编码")
private String hzCode; private String hzCode;
private String type; private String type;
@ -61,6 +64,7 @@ public class ProductInfo extends BaseEntity
private Date deletedAt; private Date deletedAt;
private String serialNumber; private String serialNumber;
private String vendorCode; private String vendorCode;
private List<String> vendorCodeList;
private String vendorName; private String vendorName;
private Long availableCount; private Long availableCount;
private Long cumulativeCount; private Long cumulativeCount;

View File

@ -57,6 +57,7 @@ public class ProjectOrderFileLog extends BaseEntity
CONFIG("1","配置器"), CONFIG("1","配置器"),
CONTRACT("2","合同"), CONTRACT("2","合同"),
CONTRACT_BAK("3","合同备份文件"), CONTRACT_BAK("3","合同备份文件"),
SIGN("4","订单签收"),
; ;
private final String code; private final String code;

View File

@ -130,6 +130,7 @@ public class ProjectOrderInfo extends BaseEntity {
@Excel(name = "进货商") @Excel(name = "进货商")
private String partnerName; private String partnerName;
private String projectPartnerName; private String projectPartnerName;
private List<String> productCodeList;
/** /**
* *

View File

@ -70,6 +70,7 @@ public class ProjectProductInfo extends BaseEntity
/** 指导折扣 */ /** 指导折扣 */
// @Excel(name = "指导折扣") // @Excel(name = "指导折扣")
private BigDecimal guidanceDiscount; private BigDecimal guidanceDiscount;
private String vendorCode;
/** 折扣 */ /** 折扣 */
// @Excel(name = "折扣") // @Excel(name = "折扣")

View File

@ -31,7 +31,7 @@ public class WarehouseInnerExcelDto {
private String productCode; private String productCode;
@Excel(name="入库价(含税)") @Excel(name="入库价(含税)")
private BigDecimal innerPrice; private BigDecimal innerPrice;
@Excel(name="入库仓") @Excel(name="仓库")
private String warehouseName; private String warehouseName;
} }

View File

@ -66,4 +66,6 @@ public interface InventoryInfoMapper
List<ProductWarehouseInfo> checkOurPreview(List<String> productCodeList); List<ProductWarehouseInfo> checkOurPreview(List<String> productCodeList);
void clearOutInfo(List<Long> idList); void clearOutInfo(List<Long> idList);
List<InventoryInfo> countBySn(List<String> productSnList);
} }

View File

@ -64,4 +64,5 @@ public interface InventoryOuterDetailMapper
void deleteByOuterCode(List<String> outerCode); void deleteByOuterCode(List<String> outerCode);
List<InventoryOuterDetail> listMailDataByOuterId(Long id);
} }

View File

@ -2,6 +2,7 @@ package com.ruoyi.sip.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.sip.domain.InventoryOuter; import com.ruoyi.sip.domain.InventoryOuter;
import com.ruoyi.sip.domain.VendorInfo;
/** /**
* Mapper * Mapper
@ -63,4 +64,6 @@ public interface InventoryOuterMapper
int selectMaxOrderCode(String string); int selectMaxOrderCode(String string);
int countByOrderCode(String orderCode); int countByOrderCode(String orderCode);
String selectVendorById(Long id);
} }

View File

@ -3,6 +3,7 @@ package com.ruoyi.sip.mapper;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import com.ruoyi.sip.domain.OmsWarehouseInfo; import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.domain.VendorInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@ -64,4 +65,8 @@ public interface OmsWarehouseInfoMapper
List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList); List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList);
List<OmsWarehouseInfo> listByIds(@Param("list") Collection<String> warehouseSet); List<OmsWarehouseInfo> listByIds(@Param("list") Collection<String> warehouseSet);
List<OmsWarehouseInfo> listAll(OmsWarehouseInfo omsWarehouseInfo);
} }

View File

@ -60,4 +60,5 @@ public interface PartnerInfoMapper
public int deletePartnerInfoByIds(String[] ids); public int deletePartnerInfoByIds(String[] ids);
public int selectCountByCode(PartnerInfo partnerInfo); public int selectCountByCode(PartnerInfo partnerInfo);
List<PartnerInfo> listByOrderCode(List<String> orderCodeList);
} }

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto; import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.ProductInfo; import com.ruoyi.sip.domain.ProductInfo;
import com.ruoyi.sip.domain.VendorInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@ -72,4 +73,6 @@ public interface ProductInfoMapper
void updateAvailableCount(@Param("quantity") Long quantity, @Param("productCode") String productCode); void updateAvailableCount(@Param("quantity") Long quantity, @Param("productCode") String productCode);
void updateCumulativeCount(@Param("quantity") Long quantity, @Param("productCode") String productCode); void updateCumulativeCount(@Param("quantity") Long quantity, @Param("productCode") String productCode);
List<String> authProductCode(VendorInfo productInfo);
} }

View File

@ -0,0 +1,27 @@
package com.ruoyi.sip.service;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.domain.VendorInfo;
import java.util.List;
/**
* @author : ch
* @version : 1.0
* @ClassName : IInventoryAuthService
* @Description :
* @DATE : Created in 11:39 2025/8/14
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/08/14 ch 1.0 Why & What is modified: <> *
*/
public interface IInventoryAuthService {
boolean authAll();
List<VendorInfo> currentVendor();
List<String> authProductCode();
List<Long> authWarehouse();
}

View File

@ -76,4 +76,6 @@ public interface IInventoryInfoService
List<ProductWarehouseInfo> checkOurPreview(List<String> productCode); List<ProductWarehouseInfo> checkOurPreview(List<String> productCode);
void clearOutInfo(List<Long> collect); void clearOutInfo(List<Long> collect);
List<String> checkUnq(List<String> productSnList);
} }

View File

@ -2,9 +2,8 @@ package com.ruoyi.sip.service;
import java.util.List; import java.util.List;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.domain.OmsInventoryInner; import com.ruoyi.sip.domain.OmsInventoryInner;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto; import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
/** /**
* Service * Service
@ -63,4 +62,5 @@ public interface IOmsInventoryInnerService
public int deleteOmsInventoryInnerById(Long id); public int deleteOmsInventoryInnerById(Long id);
void importByOuter(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode);
} }

View File

@ -30,6 +30,13 @@ public interface IOmsWarehouseInfoService
* @return * @return
*/ */
public List<OmsWarehouseInfo> selectOmsWarehouseInfoList(OmsWarehouseInfo omsWarehouseInfo); public List<OmsWarehouseInfo> selectOmsWarehouseInfoList(OmsWarehouseInfo omsWarehouseInfo);
/**
*
*
* @param omsWarehouseInfo
* @return
*/
public List<OmsWarehouseInfo> listByAuth(OmsWarehouseInfo omsWarehouseInfo);
/** /**
* *
@ -68,7 +75,12 @@ public interface IOmsWarehouseInfoService
* @param warehouseNameList * @param warehouseNameList
* @return * @return
*/ */
List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList); List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList,Boolean auth);
default List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList){
return listByNameList(warehouseNameList,true);
};
List<OmsWarehouseInfo> listByIds(Collection<String> warehouseSet); List<OmsWarehouseInfo> listByIds(Collection<String> warehouseSet);
List<OmsWarehouseInfo> list(OmsWarehouseInfo omsWarehouseInfo);
} }

View File

@ -58,4 +58,5 @@ public interface IPartnerInfoService
* @return * @return
*/ */
public int deletePartnerInfoById(Long id); public int deletePartnerInfoById(Long id);
public List<PartnerInfo> listByOrderCode(List<String> orderCodeList);
} }

View File

@ -65,4 +65,6 @@ public interface IProductInfoService
List<ProductInfo> selectProductInfoByCodeList(List<String> productCodeList); List<ProductInfo> selectProductInfoByCodeList(List<String> productCodeList);
void updateAvailableCount(Long quantity, String productCode); void updateAvailableCount(Long quantity, String productCode);
void updateCumulativeCount(Long outerSum,String productCode);
} }

View File

@ -82,5 +82,8 @@ public interface IProjectOrderInfoService
ProjectOrderInfo selectProjectOrderInfoByOrderCode(String orderCode); ProjectOrderInfo selectProjectOrderInfoByOrderCode(String orderCode);
public List<ProjectOrderFileLog> getProjectOrderFileLogs(); public List<ProjectOrderFileLog> getProjectOrderFileLogs();
void approveOrder(Todo todo); void approveOrder(Todo todo);
void sign(ProjectOrderFileLog projectOrderFileLog);
// Boolean foldOnFold(ProjectOrderInfo info); // Boolean foldOnFold(ProjectOrderInfo info);
} }

View File

@ -61,6 +61,6 @@ public interface IVendorInfoService
*/ */
public int deleteVendorInfoByVendorId(Long vendorId); public int deleteVendorInfoByVendorId(Long vendorId);
List<VendorInfo> current();
} }

View File

@ -12,10 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collections; import java.util.*;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -46,10 +43,14 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
private IInventoryOuterService outerService; private IInventoryOuterService outerService;
@Autowired @Autowired
private IVendorInfoService vendorInfoService; private IVendorInfoService vendorInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
@Override @Override
public ExecutionOrderVo selectInfo(Long id) { public ExecutionOrderVo selectInfo(Long id) {
ExecutionOrderVo vo = new ExecutionOrderVo(); ExecutionOrderVo vo = new ExecutionOrderVo();
List<VendorInfo> current = inventoryAuthService.currentVendor();
Set<String> currentVendorCodeSet = current.stream().map(VendorInfo::getVendorCode).collect(Collectors.toSet());
//基础信息 //基础信息
ProjectOrderInfo projectOrderInfo = projectOrderInfoMapper.selectProjectOrderInfoById(id); ProjectOrderInfo projectOrderInfo = projectOrderInfoMapper.selectProjectOrderInfoById(id);
vo.setProjectOrderInfo(projectOrderInfo); vo.setProjectOrderInfo(projectOrderInfo);
@ -59,6 +60,7 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
List<ProductDetail> productDetails = projectProductInfos.stream() List<ProductDetail> productDetails = projectProductInfos.stream()
.filter(item -> item.getType().equals(ProductInfo.ProductTypeEnum.HARDWARE.getType()) || .filter(item -> item.getType().equals(ProductInfo.ProductTypeEnum.HARDWARE.getType()) ||
item.getType().equals(ProductInfo.ProductTypeEnum.SOFTWARE.getType())) item.getType().equals(ProductInfo.ProductTypeEnum.SOFTWARE.getType()))
.filter(item -> currentVendorCodeSet.contains(item.getVendorCode()))
.collect(Collectors.groupingBy(ProjectProductInfo::getProductBomCode)) .collect(Collectors.groupingBy(ProjectProductInfo::getProductBomCode))
.entrySet().stream() .entrySet().stream()
.map(entry -> { .map(entry -> {
@ -110,6 +112,9 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
// 查询出库单信息 // 查询出库单信息
InventoryOuter inventoryOuter = new InventoryOuter(); InventoryOuter inventoryOuter = new InventoryOuter();
inventoryOuter.setOrderCode(projectOrderInfo.getOrderCode()); inventoryOuter.setOrderCode(projectOrderInfo.getOrderCode());
//只查询产品信息里面内容
inventoryOuter.setProductCodeList(productCodeList);
List<InventoryOuter> inventoryOuters = outerService.selectInventoryOuterList(inventoryOuter); List<InventoryOuter> inventoryOuters = outerService.selectInventoryOuterList(inventoryOuter);
vo.setInventoryOuterList(inventoryOuters); vo.setInventoryOuterList(inventoryOuters);
// 根据出库单状态设置generatedQuantity和confirmQuantity // 根据出库单状态设置generatedQuantity和confirmQuantity
@ -177,7 +182,7 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
} }
// 如果仍有未满足的需求,尝试使用默认仓库 // 如果仍有未满足的需求,尝试使用默认仓库
if (remainingQuantity > 0) { if (remainingQuantity > 0) {
List<VendorInfo> currentVendors = vendorInfoService.current(); List<VendorInfo> currentVendors = inventoryAuthService.currentVendor();
if (CollUtil.isNotEmpty(currentVendors)) { if (CollUtil.isNotEmpty(currentVendors)) {
VendorInfo defaultVendor = currentVendors.get(0); VendorInfo defaultVendor = currentVendors.get(0);

View File

@ -0,0 +1,104 @@
package com.ruoyi.sip.service.impl;
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.utils.CacheUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.domain.ProductInfo;
import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.mapper.OmsWarehouseInfoMapper;
import com.ruoyi.sip.mapper.ProductInfoMapper;
import com.ruoyi.sip.mapper.VendorInfoMapper;
import com.ruoyi.sip.service.IInventoryAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author : ch
* @version : 1.0
* @ClassName : InventoryAuthServiceImpl
* @Description :
* @DATE : Created in 11:39 2025/8/14
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/08/14 ch 1.0 Why & What is modified: <> *
*/
@Service
public class InventoryAuthServiceImpl implements IInventoryAuthService {
@Value("${unis.inventory.allAuthRole:103}")
private String allAuthRole;
@Resource
private ProductInfoMapper productInfoMapper;
@Resource
private VendorInfoMapper vendorInfoMapper;
@Resource
private OmsWarehouseInfoMapper warehouseInfoMapper;
@Override
public boolean authAll() {
SysUser sysUser = ShiroUtils.getSysUser();
Set<Long> roleSet = Arrays.stream(allAuthRole.split(",")).filter(StringUtils::isNotEmpty).map(Long::parseLong).collect(Collectors.toSet());
return sysUser.isAdmin() || sysUser.getRoles().stream().anyMatch(role -> roleSet.contains(role.getRoleId()));
}
@Override
public List<VendorInfo> currentVendor() {
VendorInfo queryParam = getQueryParam();
return vendorInfoMapper.selectVendorInfoList(queryParam);
}
private VendorInfo getQueryParam() {
SysUser user = ShiroUtils.getSysUser();
if (user == null) {
throw new ServiceException("用户不存在");
}
VendorInfo queryParam = new VendorInfo();
if (!authAll()) {
queryParam.setVendorNameList(user.getRoles().stream().map(SysRole::getRoleName).collect(Collectors.toList()));
}
return queryParam;
}
@Override
public List<String> authProductCode() {
VendorInfo queryParam = getQueryParam();
return productInfoMapper.authProductCode(queryParam);
}
@Override
public List<Long> authWarehouse() {
List<VendorInfo> vendorInfos = currentVendor();
Set<String> warehouseIdSet = new HashSet<>();
for (VendorInfo vendorInfo : vendorInfos) {
String warehouseId = vendorInfo.getWarehouseId();
warehouseIdSet.add(warehouseId);
List<String> warehouseIdList = vendorInfo.getWarehouseIdList();
if (CollUtil.isNotEmpty(warehouseIdList)) {
warehouseIdSet.addAll(warehouseIdList);
}
}
return warehouseIdSet.stream().map(Long::parseLong).collect(Collectors.toList());
}
}

View File

@ -1,12 +1,12 @@
package com.ruoyi.sip.service.impl; package com.ruoyi.sip.service.impl;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
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;
@ -40,6 +40,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
private IProjectProductInfoService projectProductInfoService; private IProjectProductInfoService projectProductInfoService;
@Autowired @Autowired
private IProjectOrderInfoService projectOrderInfoService; private IProjectOrderInfoService projectOrderInfoService;
@Autowired
private IProductInfoService productInfoService;
/** /**
* *
@ -160,6 +162,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
updateOrder.setUpdateBy(ShiroUtils.getUserId().toString()); updateOrder.setUpdateBy(ShiroUtils.getUserId().toString());
updateOrder.setDeliveryStatus(sum == allSum ? ProjectOrderInfo.DeliveryStatusEnum.ALL_DELIVERY.getCode() : ProjectOrderInfo.DeliveryStatusEnum.PART_DELIVERY.getCode()); updateOrder.setDeliveryStatus(sum == allSum ? ProjectOrderInfo.DeliveryStatusEnum.ALL_DELIVERY.getCode() : ProjectOrderInfo.DeliveryStatusEnum.PART_DELIVERY.getCode());
projectOrderInfoService.updateProjectOrderInfoByCode(updateOrder); projectOrderInfoService.updateProjectOrderInfoByCode(updateOrder);
//修改累计发货数量
productInfoService.updateCumulativeCount(outerSum, inventoryDelivery.getProductCode());
} }

View File

@ -2,6 +2,7 @@ package com.ruoyi.sip.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.InventoryInfo; import com.ruoyi.sip.domain.InventoryInfo;
@ -10,9 +11,11 @@ import com.ruoyi.sip.domain.ProductInfo;
import com.ruoyi.sip.dto.inventory.ProductWarehouseInfo; import com.ruoyi.sip.dto.inventory.ProductWarehouseInfo;
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto; import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
import com.ruoyi.sip.mapper.InventoryInfoMapper; import com.ruoyi.sip.mapper.InventoryInfoMapper;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IInventoryInfoService; import com.ruoyi.sip.service.IInventoryInfoService;
import com.ruoyi.sip.service.IOmsWarehouseInfoService; import com.ruoyi.sip.service.IOmsWarehouseInfoService;
import com.ruoyi.sip.service.IProductInfoService; import com.ruoyi.sip.service.IProductInfoService;
import liquibase.pro.packaged.O;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -37,6 +40,8 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
private IProductInfoService productInfoService; private IProductInfoService productInfoService;
@Autowired @Autowired
private IOmsWarehouseInfoService warehouseInfoService; private IOmsWarehouseInfoService warehouseInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
/** /**
* *
@ -112,8 +117,9 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
return Collections.emptyList(); return Collections.emptyList();
} }
List<String> authProductCodeList = inventoryAuthService.authProductCode();
List<String> productCodeList = excelList.stream().map(WarehouseInnerExcelDto::getProductCode) List<String> productCodeList = excelList.stream().map(WarehouseInnerExcelDto::getProductCode)
.filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList()); .filter(StringUtils::isNotEmpty).filter(authProductCodeList::contains).distinct().collect(Collectors.toList());
List<ProductInfo> productInfos = productInfoService.selectProductInfoByCodeList(productCodeList); List<ProductInfo> productInfos = productInfoService.selectProductInfoByCodeList(productCodeList);
Map<String, ProductInfo> productInfoMap = productInfos.stream() Map<String, ProductInfo> productInfoMap = productInfos.stream()
.collect(Collectors.toMap(ProductInfo::getProductCode, Function.identity(), (v1, v2) -> v1)); .collect(Collectors.toMap(ProductInfo::getProductCode, Function.identity(), (v1, v2) -> v1));
@ -128,19 +134,23 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
inventoryInfo.setInventoryStatus(InventoryInfo.InventoryStatusEnum.INNER.getCode()); inventoryInfo.setInventoryStatus(InventoryInfo.InventoryStatusEnum.INNER.getCode());
inventoryInfo.setProductCode(excel.getProductCode()); inventoryInfo.setProductCode(excel.getProductCode());
inventoryInfo.setProductSn(excel.getProductSn()); inventoryInfo.setProductSn(excel.getProductSn());
if (excel.getInnerPrice()==null){
throw new ServiceException("入库价未填写,导入失败");
}
inventoryInfo.setInnerPrice(excel.getInnerPrice()); inventoryInfo.setInnerPrice(excel.getInnerPrice());
if (warehouseInfoMap.containsKey(excel.getWarehouseName())){ if (!warehouseInfoMap.containsKey(excel.getWarehouseName())) {
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(excel.getWarehouseName()); throw new ServiceException("仓库未找到,导入失败");
inventoryInfo.setWarehouseId(omsWarehouseInfo.getId());
inventoryInfo.setWarehouseName(omsWarehouseInfo.getWarehouseName());
} }
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(excel.getWarehouseName());
if (productInfoMap.containsKey(excel.getProductCode())){ inventoryInfo.setWarehouseId(omsWarehouseInfo.getId());
ProductInfo productInfo = productInfoMap.get(excel.getProductCode()); inventoryInfo.setWarehouseName(omsWarehouseInfo.getWarehouseName());
inventoryInfo.setModel(productInfo.getModel()); if (!productInfoMap.containsKey(excel.getProductCode())) {
inventoryInfo.setProductDesc(productInfo.getDescription()); throw new ServiceException("产品未找到,导入失败");
inventoryInfo.setProductCode(productInfo.getProductCode());
} }
ProductInfo productInfo = productInfoMap.get(excel.getProductCode());
inventoryInfo.setModel(productInfo.getModel());
inventoryInfo.setProductDesc(productInfo.getDescription());
inventoryInfo.setProductCode(productInfo.getProductCode());
return inventoryInfo; return inventoryInfo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@ -163,5 +173,14 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
inventoryInfoMapper.clearOutInfo(idList); inventoryInfoMapper.clearOutInfo(idList);
} }
@Override
public List<String> checkUnq(List<String> productSnList) {
List<InventoryInfo> inventoryInfos = inventoryInfoMapper.countBySn(productSnList);
if (CollUtil.isNotEmpty(inventoryInfos)) {
return inventoryInfos.stream().map(InventoryInfo::getProductSn).collect(Collectors.toList());
}
return Collections.emptyList();
}
} }

View File

@ -7,21 +7,27 @@ import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Dict;
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;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.*; import com.ruoyi.sip.domain.*;
import com.ruoyi.sip.dto.inventory.ProductWarehouseInfo; import com.ruoyi.sip.dto.inventory.ProductWarehouseInfo;
import com.ruoyi.sip.mapper.InventoryOuterDetailMapper;
import com.ruoyi.sip.service.*; import com.ruoyi.sip.service.*;
import com.ruoyi.sip.utils.TemplateMailUtil;
import com.ruoyi.sip.vo.OuterDeliveryProductVo; import com.ruoyi.sip.vo.OuterDeliveryProductVo;
import com.ruoyi.sip.vo.OuterDeliveryVo; import com.ruoyi.sip.vo.OuterDeliveryVo;
import liquibase.pro.packaged.A; import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.InventoryOuterMapper; import com.ruoyi.sip.mapper.InventoryOuterMapper;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.annotation.ApplicationScope;
/** /**
* Service * Service
@ -31,11 +37,14 @@ import org.springframework.web.context.annotation.ApplicationScope;
*/ */
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Slf4j
public class InventoryOuterServiceImpl implements IInventoryOuterService public class InventoryOuterServiceImpl implements IInventoryOuterService
{ {
@Autowired @Autowired
private InventoryOuterMapper inventoryOuterMapper; private InventoryOuterMapper inventoryOuterMapper;
@Autowired
private InventoryOuterDetailMapper inventoryOuterDetailMapper;
@Autowired @Autowired
private IProjectOrderInfoService orderInfoService; private IProjectOrderInfoService orderInfoService;
@Autowired @Autowired
@ -46,6 +55,12 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
private IInventoryDeliveryService deliveryService; private IInventoryDeliveryService deliveryService;
@Autowired @Autowired
private IProjectProductInfoService projectProductInfoService; private IProjectProductInfoService projectProductInfoService;
@Autowired
private ISysUserService userService;
@Autowired
private IVendorInfoService vendorService;
@Value("${unis.mail.businessRoleId:103}")
private String businessRoleId;
/** /**
* *
* *
@ -196,15 +211,42 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
if (count == 0L) { if (count == 0L) {
projectOrderInfo.setOuterStatus(ProjectOrderInfo.OuterStatusEnum.NOT_OUTER.getCode()); projectOrderInfo.setOuterStatus(ProjectOrderInfo.OuterStatusEnum.NOT_OUTER.getCode());
} else { } else {
projectOrderInfo.setOuterStatus(count == sum ? ProjectOrderInfo.OuterStatusEnum.ALL_OUTER.getCode() : ProjectOrderInfo.OuterStatusEnum.PART_OUTER.getCode()); projectOrderInfo.setOuterStatus(count == sum ? ProjectOrderInfo.OuterStatusEnum.ALL_OUTER.getCode() : ProjectOrderInfo.OuterStatusEnum.PART_OUTER.getCode());
} }
} }
orderInfoService.updateProjectOrderInfoByCode(projectOrderInfo); orderInfoService.updateProjectOrderInfoByCode(projectOrderInfo);
//确认出库需发送邮件
if (InventoryOuter.OuterStatusEnum.WAIT_RECEIVE.getCode().equals(inventoryOuter.getOuterStatus())) {
//查询商务
List<SysUser> sysUsers = userService.listByRoleId(businessRoleId);
List<String> emailList = sysUsers.stream().map(SysUser::getEmail).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
//查询制造商
String email = inventoryOuterMapper.selectVendorById(inventoryOuter.getId());
if (StringUtils.isNotEmpty(email)) {
emailList.add(email);
}
List<InventoryOuterDetail> inventoryOuterDetails = inventoryOuterDetailMapper.listMailDataByOuterId(inventoryOuter.getId());
this.sendDeliveryMail(emailList.stream().distinct().collect(Collectors.toList()),
orderInfoService.selectProjectOrderInfoByOrderCode(inventoryOuter.getOrderCode()),inventoryOuterDetails);
}
inventoryOuter.setOrderCode(null); inventoryOuter.setOrderCode(null);
return this.updateInventoryOuter(inventoryOuter); return this.updateInventoryOuter(inventoryOuter);
} }
private void sendDeliveryMail(List<String> toEmail, ProjectOrderInfo projectOrderInfo, List<InventoryOuterDetail> inventoryOuterDetails) {
if (CollUtil.isEmpty(toEmail)) {
log.info("发货邮件发送失败,收件人为空");
return;
}
String templateTile = "{}-紫光汇智云桌面-{}-供应商通知发货单";
String title = StringUtils.format(templateTile, projectOrderInfo.getOrderCode(), projectOrderInfo.getProjectName());
TemplateMailUtil.sendTemplateMail(toEmail, title,
TemplateMailUtil.MailTemplate.ORDER_DELIVERY, Dict.create().set("productList", inventoryOuterDetails));
}
@Override @Override
public OuterDeliveryVo selectBaseInfoById(Long id) { public OuterDeliveryVo selectBaseInfoById(Long id) {
OuterDeliveryVo outerDeliveryVo = new OuterDeliveryVo(); OuterDeliveryVo outerDeliveryVo = new OuterDeliveryVo();

View File

@ -1,26 +1,24 @@
package com.ruoyi.sip.service.impl; package com.ruoyi.sip.service.impl;
import java.util.Collections; import java.util.*;
import java.util.Date; import java.util.function.Function;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
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;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.InventoryInfo; import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.domain.OmsWarehouseInfo;
import com.ruoyi.sip.domain.VendorInfo; import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IInventoryInfoService; import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
import com.ruoyi.sip.service.IProductInfoService; import com.ruoyi.sip.service.*;
import com.ruoyi.sip.service.IVendorInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.OmsInventoryInnerMapper; import com.ruoyi.sip.mapper.OmsInventoryInnerMapper;
import com.ruoyi.sip.domain.OmsInventoryInner; import com.ruoyi.sip.domain.OmsInventoryInner;
import com.ruoyi.sip.service.IOmsInventoryInnerService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -42,6 +40,10 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
private IVendorInfoService vendorInfoService; private IVendorInfoService vendorInfoService;
@Autowired @Autowired
private IProductInfoService productInfoService; private IProductInfoService productInfoService;
@Autowired
private IOmsWarehouseInfoService warehouseInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
/** /**
* *
@ -62,13 +64,13 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
*/ */
@Override @Override
public List<OmsInventoryInner> selectOmsInventoryInnerList(OmsInventoryInner omsInventoryInner) { public List<OmsInventoryInner> selectOmsInventoryInnerList(OmsInventoryInner omsInventoryInner) {
if (!ShiroUtils.getSysUser().isAdmin()){ if (!inventoryAuthService.authAll()){
List<VendorInfo> current = vendorInfoService.current(); List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
if (CollUtil.isEmpty(current)){ if (CollUtil.isEmpty(vendorInfos)){
return Collections.emptyList(); return Collections.emptyList();
} }
omsInventoryInner.setVendorCode(current.get(0).getVendorCode()); omsInventoryInner.setVendorCode(vendorInfos.get(0).getVendorCode());
} }
return omsInventoryInnerMapper.selectOmsInventoryInnerList(omsInventoryInner); return omsInventoryInnerMapper.selectOmsInventoryInnerList(omsInventoryInner);
} }
@ -80,7 +82,7 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
*/ */
@Override @Override
public int insertOmsInventoryInner(OmsInventoryInner omsInventoryInner) { public int insertOmsInventoryInner(OmsInventoryInner omsInventoryInner) {
//生成库单 //生成库单
omsInventoryInner.setInnerCode(generateInnerCode()); omsInventoryInner.setInnerCode(generateInnerCode());
Date nowDate = DateUtils.getNowDate(); Date nowDate = DateUtils.getNowDate();
omsInventoryInner.setCreateTime(nowDate); omsInventoryInner.setCreateTime(nowDate);
@ -106,6 +108,11 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
item.setCreateBy(currentUserId); item.setCreateBy(currentUserId);
item.setCreateTime(nowDate); item.setCreateTime(nowDate);
}); });
//校验sn是否重复
List<String> repeatSnList = inventoryInfoService.checkUnq(inventoryInfoList.stream().map(InventoryInfo::getProductSn).collect(Collectors.toList()));
if (CollUtil.isNotEmpty(repeatSnList)) {
throw new ServiceException(StrUtil.format("SN码[{}]已存在,保存失败", repeatSnList));
}
inventoryInfoService.saveBatch(inventoryInfoList); inventoryInfoService.saveBatch(inventoryInfoList);
productInfoService.updateAvailableCount(omsInventoryInner.getQuantity(),omsInventoryInner.getProductCode()); productInfoService.updateAvailableCount(omsInventoryInner.getQuantity(),omsInventoryInner.getProductCode());
return omsInventoryInnerMapper.insertOmsInventoryInner(omsInventoryInner); return omsInventoryInnerMapper.insertOmsInventoryInner(omsInventoryInner);
@ -154,5 +161,41 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
return omsInventoryInnerMapper.deleteOmsInventoryInnerById(id); return omsInventoryInnerMapper.deleteOmsInventoryInnerById(id);
} }
@Override
public void importByOuter(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode) {
long count = inventoryInfoExcelDtoList.stream().filter(item -> !item.getProductCode().equals(productCode)).count();
if (count > 0){
throw new ServiceException("导入清单的产品与出库单不符");
}
List<String> warehouseNameList = inventoryInfoExcelDtoList.stream().map(InventoryInfoExcelDto::getWarehouseName).distinct().collect(Collectors.toList());
if (warehouseNameList.size() > 1){
throw new ServiceException("导入清单只能有一个仓库");
}
List<OmsWarehouseInfo> warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList);
Map<String, OmsWarehouseInfo> warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
List<InventoryInfo> inventoryInfoList = inventoryInfoExcelDtoList.stream().map(item -> {
InventoryInfo info = new InventoryInfo();
info.setInventoryStatus(InventoryInfo.InventoryStatusEnum.INNER.getCode());
info.setProductSn(item.getProductSn());
info.setProductCode(productCode);
info.setInnerPrice(item.getInnerPrice());
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(item.getWarehouseName());
if (omsWarehouseInfo == null){
throw new ServiceException("仓库未找到,导入失败");
}
info.setWarehouseId(omsWarehouseInfo.getId());
return info;
}).collect(Collectors.toList());
OmsInventoryInner omsInventoryInner = new OmsInventoryInner();
omsInventoryInner.setVendorCode(inventoryAuthService.currentVendor().get(0).getVendorCode());
omsInventoryInner.setProductCode(productCode);
omsInventoryInner.setWarehouseId(warehouseInfoList.get(0).getId());
omsInventoryInner.setInventoryInfoList(inventoryInfoList);
this.insertOmsInventoryInner(omsInventoryInner);
}
} }

View File

@ -1,15 +1,21 @@
package com.ruoyi.sip.service.impl; package com.ruoyi.sip.service.impl;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import liquibase.pro.packaged.O; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IVendorInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.OmsWarehouseInfoMapper; import com.ruoyi.sip.mapper.OmsWarehouseInfoMapper;
import com.ruoyi.sip.domain.OmsWarehouseInfo; import com.ruoyi.sip.domain.OmsWarehouseInfo;
@ -26,7 +32,10 @@ import com.ruoyi.common.core.text.Convert;
public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService { public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
@Autowired @Autowired
private OmsWarehouseInfoMapper omsWarehouseInfoMapper; private OmsWarehouseInfoMapper omsWarehouseInfoMapper;
@Autowired
private IVendorInfoService vendorInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
/** /**
* *
* *
@ -49,6 +58,18 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
return omsWarehouseInfoMapper.selectOmsWarehouseInfoList(omsWarehouseInfo); return omsWarehouseInfoMapper.selectOmsWarehouseInfoList(omsWarehouseInfo);
} }
@Override
public List<OmsWarehouseInfo> listByAuth(OmsWarehouseInfo omsWarehouseInfo) {
if (!inventoryAuthService.authAll()) {
List<Long> idList = inventoryAuthService.authWarehouse();
if (CollUtil.isEmpty(idList)) {
return Collections.emptyList();
}
omsWarehouseInfo.setIdList(idList);
}
return omsWarehouseInfoMapper.selectOmsWarehouseInfoList(omsWarehouseInfo);
}
/** /**
* *
* *
@ -65,7 +86,7 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
private void checkUnqCode(OmsWarehouseInfo omsWarehouseInfo) { private void checkUnqCode(OmsWarehouseInfo omsWarehouseInfo) {
OmsWarehouseInfo queryDto = new OmsWarehouseInfo(); OmsWarehouseInfo queryDto = new OmsWarehouseInfo();
queryDto.setWarehouseCode(omsWarehouseInfo.getWarehouseCode()); queryDto.setWarehouseName(omsWarehouseInfo.getWarehouseName());
List<OmsWarehouseInfo> omsWarehouseInfos = omsWarehouseInfoMapper.selectOmsWarehouseInfoList(queryDto); List<OmsWarehouseInfo> omsWarehouseInfos = omsWarehouseInfoMapper.selectOmsWarehouseInfoList(queryDto);
//code查询记录为空直接保存 //code查询记录为空直接保存
if (CollUtil.isEmpty(omsWarehouseInfos)) { if (CollUtil.isEmpty(omsWarehouseInfos)) {
@ -73,12 +94,12 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
} }
//是否新增 //是否新增
if (omsWarehouseInfo.getId() == null) { if (omsWarehouseInfo.getId() == null) {
throw new RuntimeException("仓库编码重复,保存失败"); throw new RuntimeException("仓库名称重复,保存失败");
} }
//编辑需剔除当前数据 //编辑需剔除当前数据
long count = omsWarehouseInfos.stream().filter(item -> !item.getId().equals(omsWarehouseInfo.getId())).count(); long count = omsWarehouseInfos.stream().filter(item -> !item.getId().equals(omsWarehouseInfo.getId())).count();
if (count > 0) { if (count > 0) {
throw new RuntimeException("仓库编码重复,保存失败"); throw new RuntimeException("仓库名称重复,保存失败");
} }
} }
@ -119,10 +140,15 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
} }
@Override @Override
public List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList) { public List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList, Boolean auth) {
if (CollUtil.isEmpty(warehouseNameList)){ if (CollUtil.isEmpty(warehouseNameList)){
return Collections.emptyList(); return Collections.emptyList();
} }
if (auth == null || auth) {
OmsWarehouseInfo omsWarehouseInfo = new OmsWarehouseInfo();
omsWarehouseInfo.setWarehouseNameList(warehouseNameList);
return listByAuth(omsWarehouseInfo);
}
return omsWarehouseInfoMapper.listByNameList(warehouseNameList); return omsWarehouseInfoMapper.listByNameList(warehouseNameList);
} }
@ -130,4 +156,9 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
public List<OmsWarehouseInfo> listByIds(Collection<String> warehouseSet) { public List<OmsWarehouseInfo> listByIds(Collection<String> warehouseSet) {
return omsWarehouseInfoMapper.listByIds(warehouseSet); return omsWarehouseInfoMapper.listByIds(warehouseSet);
} }
@Override
public List<OmsWarehouseInfo> list(OmsWarehouseInfo omsWarehouseInfo) {
return omsWarehouseInfoMapper.listAll(omsWarehouseInfo);
}
} }

View File

@ -1,5 +1,6 @@
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 com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
@ -104,4 +105,9 @@ public class PartnerInfoServiceImpl implements IPartnerInfoService
{ {
return partnerInfoMapper.deletePartnerInfoById(id); return partnerInfoMapper.deletePartnerInfoById(id);
} }
@Override
public List<PartnerInfo> listByOrderCode(List<String> orderCodeList) {
return partnerInfoMapper.listByOrderCode(orderCodeList);
}
} }

View File

@ -1,14 +1,20 @@
package com.ruoyi.sip.service.impl; package com.ruoyi.sip.service.impl;
import java.util.ArrayList;
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.collection.CollUtil;
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.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.MaintenanceRecordsDto; import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IVendorInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.ProductInfoMapper; import com.ruoyi.sip.mapper.ProductInfoMapper;
import com.ruoyi.sip.domain.ProductInfo; import com.ruoyi.sip.domain.ProductInfo;
@ -26,7 +32,10 @@ public class ProductInfoServiceImpl implements IProductInfoService
{ {
@Autowired @Autowired
private ProductInfoMapper productInfoMapper; private ProductInfoMapper productInfoMapper;
@Autowired
private IVendorInfoService vendorInfoService;
@Value("${unis.mail.businessRoleId:103}")
private String businessRoleId;
/** /**
* *
* *
@ -129,4 +138,9 @@ public class ProductInfoServiceImpl implements IProductInfoService
public void updateAvailableCount(Long quantity, String productCode) { public void updateAvailableCount(Long quantity, String productCode) {
productInfoMapper.updateAvailableCount(quantity,productCode); productInfoMapper.updateAvailableCount(quantity,productCode);
} }
@Override
public void updateCumulativeCount(Long outerSum, String productCode) {
productInfoMapper.updateCumulativeCount(outerSum, productCode);
}
} }

View File

@ -1,9 +1,6 @@
package com.ruoyi.sip.service.impl; package com.ruoyi.sip.service.impl;
import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URL;
import java.nio.charset.Charset;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
@ -12,15 +9,7 @@ import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Dict; import cn.hutool.core.lang.Dict;
import cn.hutool.extra.mail.Mail;
import cn.hutool.extra.mail.MailUtil;
import cn.hutool.extra.template.Template;
import cn.hutool.extra.template.TemplateConfig;
import cn.hutool.extra.template.TemplateEngine;
import cn.hutool.extra.template.TemplateUtil;
import cn.hutool.extra.template.engine.thymeleaf.ThymeleafEngine;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.metadata.CellData; import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head; import com.alibaba.excel.metadata.Head;
@ -36,9 +25,7 @@ import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.sip.domain.*; import com.ruoyi.sip.domain.*;
import com.ruoyi.sip.flowable.domain.BuApproveConfig;
import com.ruoyi.sip.flowable.domain.Todo; import com.ruoyi.sip.flowable.domain.Todo;
import com.ruoyi.sip.dto.HomepageQueryDto; import com.ruoyi.sip.dto.HomepageQueryDto;
import com.ruoyi.sip.dto.OrderExcelNumStaticsDto; import com.ruoyi.sip.dto.OrderExcelNumStaticsDto;
@ -50,7 +37,7 @@ import com.ruoyi.sip.flowable.service.DeleteFlowableProcessInstanceCmd;
import com.ruoyi.sip.flowable.service.TodoCommonTemplate; import com.ruoyi.sip.flowable.service.TodoCommonTemplate;
import com.ruoyi.sip.flowable.service.TodoService; import com.ruoyi.sip.flowable.service.TodoService;
import com.ruoyi.sip.utils.TemplateMailUtil; import com.ruoyi.sip.utils.TemplateMailUtil;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
@ -60,7 +47,6 @@ import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task; import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.ProjectOrderInfoMapper; import com.ruoyi.sip.mapper.ProjectOrderInfoMapper;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
@ -102,7 +88,9 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
@Autowired @Autowired
protected ManagementService managementService; protected ManagementService managementService;
@Autowired @Autowired
private SysUserMapper userMapper; private IPartnerInfoService partnerInfoService;
@Autowired
private ISysUserService userService;
private static final List<String> MAINTENANCE_SERVICES = Arrays.asList("8813A3YA", "8813A3YB", "8813A7U4", "8813A7U2"); private static final List<String> MAINTENANCE_SERVICES = Arrays.asList("8813A3YA", "8813A3YB", "8813A7U4", "8813A7U2");
private static final List<String> DEPLOY_SERVICES = Arrays.asList("8814A0BT"); private static final List<String> DEPLOY_SERVICES = Arrays.asList("8814A0BT");
private static final List<String> WSS_LIST = Arrays.asList("3130A6LC"); private static final List<String> WSS_LIST = Arrays.asList("3130A6LC");
@ -118,6 +106,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
private IBuApproveConfigService approveConfigService; private IBuApproveConfigService approveConfigService;
@Value("${unis.order.endHour:96}") @Value("${unis.order.endHour:96}")
private Integer endHour; private Integer endHour;
@Value("${unis.mail.businessRoleId:103}")
private String businessRoleId;
/** /**
* *
* *
@ -531,6 +521,15 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
complete(todo.getVariables(), todo.getTaskId(), getFlowBusinessKey(todo.getBusinessKey(),null)); complete(todo.getVariables(), todo.getTaskId(), getFlowBusinessKey(todo.getBusinessKey(),null));
} }
@Override
public void sign(ProjectOrderFileLog projectOrderFileLog) {
fileLogService.insertProjectOrderFileLog(projectOrderFileLog);
ProjectOrderInfo projectOrderInfo = new ProjectOrderInfo();
projectOrderInfo.setId(projectOrderFileLog.getOrderId());
projectOrderInfo.setSignStatus(ProjectOrderInfo.SignStatusEnum.SIGN.getCode());
projectOrderInfoMapper.updateProjectOrderInfo(projectOrderInfo);
}
// @Override // @Override
// public Boolean foldOnFold(ProjectOrderInfo projectOrderInfo) { // public Boolean foldOnFold(ProjectOrderInfo projectOrderInfo) {
// if (projectOrderInfo == null) { // if (projectOrderInfo == null) {
@ -1031,16 +1030,17 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
projectOrderInfoMapper.bakData(projectOrderInfo); projectOrderInfoMapper.bakData(projectOrderInfo);
//修改产品数据 //修改产品数据
// projectInfo // projectInfo
if (dbProjectOrderInfo.getDiscountFold().compareTo(BigDecimal.ONE)!=0){ if (dbProjectOrderInfo.getDiscountFold().compareTo(BigDecimal.ONE) != 0) {
productInfoService.calcByDiscountFold(dbProjectOrderInfo.getDiscountFold(), dbProjectOrderInfo.getProjectId()); productInfoService.calcByDiscountFold(dbProjectOrderInfo.getDiscountFold(), dbProjectOrderInfo.getProjectId());
} }
//查询商务
//todo 总代 发 代理商 商务 执行单发 商务 制造商 List<SysUser> sysUsers = userService.listByRoleId(businessRoleId);
List<String> emailList = sysUsers.stream().map(SysUser::getEmail).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
//查询代理商
List<PartnerInfo> partnerInfos = partnerInfoService.listByOrderCode(Collections.singletonList(dbProjectOrderInfo.getOrderCode()));
emailList.addAll(partnerInfos.stream().map(PartnerInfo::getContactEmail).filter(StringUtils::isNotEmpty).collect(Collectors.toList()));
this.sendPartnerMail(emailList.stream().distinct().collect(Collectors.toList()), dbProjectOrderInfo);
} }
} }
return TodoCommonTemplate.super.todoApproveCallback(todo); return TodoCommonTemplate.super.todoApproveCallback(todo);
@ -1056,20 +1056,16 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
return null; return null;
} }
private void sendDeliveryMail(List<String> toEmail,ProjectOrderInfo projectOrderInfo){ private void sendPartnerMail(List<String> toEmail, ProjectOrderInfo projectOrderInfo){
if (CollUtil.isEmpty(toEmail)){ if (CollUtil.isEmpty(toEmail)){
log.info("发货邮件发送失败,收件人为空"); log.info("发货邮件发送失败,收件人为空");
return; return;
} }
List<ProjectProductInfo> projectProductInfos = productInfoService.selectProjectProductInfoListByProjectId(Collections.singletonList(projectOrderInfo.getProjectId())); String templateTile="{}-紫光汇智云桌面-{}-进供货执行通知";
if (CollUtil.isEmpty(projectProductInfos)){
log.info("发货邮件发送失败,产品信息为空");
return;
}
String templateTile="{}-紫光汇智云桌面-{}-供应商通知发货单";
String title = StringUtils.format(templateTile, projectOrderInfo.getOrderCode(), projectOrderInfo.getProjectName()); String title = StringUtils.format(templateTile, projectOrderInfo.getOrderCode(), projectOrderInfo.getProjectName());
TemplateMailUtil.sendTemplateMail(toEmail,title, TemplateMailUtil.sendTemplateMail(toEmail,title,
TemplateMailUtil.MailTemplate.ORDER_DELIVERY,Dict.create().set("productList", projectProductInfos)); TemplateMailUtil.MailTemplate.ORDER_PARTNER,Dict.create());
} }
} }

View File

@ -119,14 +119,4 @@ public class VendorInfoServiceImpl implements IVendorInfoService {
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

@ -42,7 +42,7 @@ public class TemplateMailUtil {
*/ */
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 enabled = SpringUtils.getProperty("unis.mail.enabled", "false"); String enabled = SpringUtils.getProperty("unis.mail.enabled", "false");
if (Boolean.getBoolean(enabled)) { if (!Boolean.getBoolean(enabled)) {
log.warn("邮件发送开关未开启"); log.warn("邮件发送开关未开启");
return; return;
} }
@ -73,6 +73,7 @@ public class TemplateMailUtil {
* *
*/ */
ORDER_DELIVERY("mailOrderDeliveryTemplate.html","供应商通知发货单"), ORDER_DELIVERY("mailOrderDeliveryTemplate.html","供应商通知发货单"),
ORDER_PARTNER("mailPartnerTemplate.html","代理商商通知"),
; ;

View File

@ -40,17 +40,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectInventoryDeliveryList" parameterType="InventoryDelivery" resultMap="InventoryDeliveryResult"> <select id="selectInventoryDeliveryList" parameterType="InventoryDelivery" resultMap="InventoryDeliveryResult">
<include refid="selectInventoryDeliveryVo"/> <include refid="selectInventoryDeliveryVo"/>
<where> <where>
<if test="outerCode != null and outerCode != ''"> and t1.outer_code = #{outerCode}</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="warehouseId != null ">and t1.warehouse_id = #{warehouseId}</if>
<if test="logisticsCompany != null and logisticsCompany != ''"> and t1.logistics_company = #{logisticsCompany}</if> <if test="logisticsCompany != null and logisticsCompany != ''">and t1.logistics_company =
<if test="deliveryStatus != null and deliveryStatus != ''"> and t1.delivery_status = #{deliveryStatus}</if> #{logisticsCompany}
<if test="logisticsCode != null and logisticsCode != ''"> and t1.logistics_code = #{logisticsCode}</if> </if>
<if test="deliveryTimeType != null and deliveryTimeType != ''"> and t1.delivery_time_type = #{deliveryTimeType}</if> <if test="deliveryStatus != null and deliveryStatus != ''">and t1.delivery_status = #{deliveryStatus}</if>
<if test="deliveryTime != null "> and t1.delivery_time = #{deliveryTime}</if> <if test="logisticsCode != null and logisticsCode != ''">and t1.logistics_code = #{logisticsCode}</if>
<if test="deliveryType != null and deliveryType != ''"> and t1.delivery_type = #{deliveryType}</if> <if test="deliveryTimeType != null and deliveryTimeType != ''">and t1.delivery_time_type =
<if test="projectCode != null and projectCode != ''"> and t5.project_code = #{projectCode}</if> #{deliveryTimeType}
<if test="orderCode != null and orderCode != ''"> and t3.order_code = #{orderCode}</if> </if>
<if test="projectName != null and projectName != ''"> and t5.project_name like concat('%',#{projectName},'%')</if> <if test="deliveryTime != null ">and t1.delivery_time = #{deliveryTime}</if>
<if test="deliveryType != null and deliveryType != ''">and t1.delivery_type = #{deliveryType}</if>
<if test="projectCode != null and projectCode != ''">and t5.project_code = #{projectCode}</if>
<if test="productCodeList != null and productCodeList.size>0">and t3.product_code in
<foreach item="item" index="index" collection="productCodeList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="orderCode != null and orderCode != ''">and t3.order_code = #{orderCode}</if>
<if test="projectName != null and projectName != ''">and t5.project_name like
concat('%',#{projectName},'%')
</if>
</where> </where>
</select> </select>

View File

@ -32,14 +32,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectInventoryInfoList" parameterType="InventoryInfo" resultMap="InventoryInfoResult"> <select id="selectInventoryInfoList" parameterType="InventoryInfo" resultMap="InventoryInfoResult">
<include refid="selectInventoryInfoVo"/> <include refid="selectInventoryInfoVo"/>
<where> <where>
<if test="productCode != null and productCode != ''"> and t1.product_code = #{productCode}</if> <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="productCodeList != null and productCodeList != ''">and t1.product_code in
<if test="inventoryStatus != null and inventoryStatus != ''"> and t1.inventory_status = #{inventoryStatus}</if> <foreach item="item" index="index" collection="productCodeList" separator="," open="(" close=")">
<if test="innerCode != null and innerCode != ''"> and t1.inner_code = #{innerCode}</if> #{item}
<if test="outerCode != null and outerCode != ''"> and t1.outer_code = #{outerCode}</if> </foreach>
<if test="warehouseId != null "> and t1.warehouse_id = #{warehouseId}</if> </if>
<if test="innerPrice != null "> and t1.inner_price = #{innerPrice}</if> <if test="productSn != null and productSn != ''">and t1.product_sn = #{productSn}</if>
<if test="outerPrice != null "> and t1.outer_price = #{outerPrice}</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> </where>
</select> </select>
@ -61,6 +67,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN oms_warehouse_info t2 ON t1.warehouse_id = t2.id LEFT JOIN oms_warehouse_info t2 ON t1.warehouse_id = t2.id
order by t1.available_count order by t1.available_count
</select> </select>
<select id="countBySn" resultMap="InventoryInfoResult">
select product_sn from oms_inventory_info where product_sn in
<foreach item="item" index="index" collection="list" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<insert id="insertInventoryInfo" parameterType="InventoryInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertInventoryInfo" parameterType="InventoryInfo" useGeneratedKeys="true" keyProperty="id">

View File

@ -42,6 +42,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectInventoryOuterDetailVo"/> <include refid="selectInventoryOuterDetailVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="listMailDataByOuterId" resultMap="InventoryOuterDetailResult">
SELECT
t1.product_code,t4.product_name,t4.model,t3.warehouse_name,t2.quantity
FROM
oms_inventory_outer t1
LEFT JOIN oms_inventory_outer_detail t2 ON t2.outer_code = t1.outer_code
left join oms_warehouse_info t3 on t2.warehouse_id=t3.id
left join product_info t4 on t1.product_code=t4.product_code
WHERE
t1.id = 8
</select>
<insert id="insertInventoryOuterDetail" parameterType="InventoryOuterDetail" useGeneratedKeys="true" keyProperty="id"> <insert id="insertInventoryOuterDetail" parameterType="InventoryOuterDetail" useGeneratedKeys="true" keyProperty="id">
insert into oms_inventory_outer_detail insert into oms_inventory_outer_detail

View File

@ -59,13 +59,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.update_time, t1.update_time,
t1.delivery_status, t1.delivery_status,
t2.model, t2.model,
t3.id as order_id,
t5.user_name as createByName,
t4.project_code, t4.project_code,
t4.project_name t4.project_name
from oms_inventory_outer t1 from oms_inventory_outer t1
left join product_info t2 on t1.product_code = t2.product_code left join product_info t2 on t1.product_code = t2.product_code
left join project_order_info t3 on t1.order_code = t3.order_code left join project_order_info t3 on t1.order_code = t3.order_code
left join project_info t4 on t4.id = t3.project_id left join project_info t4 on t4.id = t3.project_id
left join sys_user t5 on t1.create_by = t5.user_id
</sql> </sql>
@ -141,6 +143,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectInventoryOuterRelationVo"/> <include refid="selectInventoryOuterRelationVo"/>
where t1.outer_code=#{code} where t1.outer_code=#{code}
</select> </select>
<select id="selectVendorById" resultType="String">
select t2.vendor_email from product_info t1 left join oms_vendor_info t2 on t1.vendor_code=t2.vendor_code where t1.product_code in (
select product_code from oms_inventory_outer where id=8)
</select>
<insert id="insertInventoryOuter" parameterType="InventoryOuter" useGeneratedKeys="true" keyProperty="id"> <insert id="insertInventoryOuter" parameterType="InventoryOuter" useGeneratedKeys="true" keyProperty="id">
insert into oms_inventory_outer insert into oms_inventory_outer

View File

@ -19,23 +19,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectOmsInventoryInnerVo"> <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, 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, t2.warehouse_name, t3.user_name as create_by_name,
t4.vendor_name t4.vendor_name,t5.model
from oms_inventory_inner t1 from oms_inventory_inner t1
left join oms_warehouse_info t2 on t1.warehouse_id = t2.id 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 oms_vendor_info t4 on t1.vendor_code = t4.vendor_code
left join sys_user t3 on t1.create_by = t3.user_id left join sys_user t3 on t1.create_by = t3.user_id
left join product_info t5 on t1.product_code = t5.product_code
</sql> </sql>
<select id="selectOmsInventoryInnerList" parameterType="OmsInventoryInner" resultMap="OmsInventoryInnerResult"> <select id="selectOmsInventoryInnerList" parameterType="OmsInventoryInner" resultMap="OmsInventoryInnerResult">
<include refid="selectOmsInventoryInnerVo"/> <include refid="selectOmsInventoryInnerVo"/>
<where> <where>
<if test="vendorCode != null and vendorCode != ''"> and t1.vendorr_code = #{vendorCode}</if> <if test="vendorCode != null and vendorCode != ''"> and t1.vendor_code = #{vendorCode}</if>
<if test="innerCode != null and innerCode != ''"> and t1.inner_code = #{innerCode}</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="productCode != null and productCode != ''"> and t1.product_code = #{productCode}</if>
<if test="quantity != null "> and t1.quantity = #{quantity}</if> <if test="quantity != null "> and t1.quantity = #{quantity}</if>
<if test="warehouseId != null "> and t1.warehouse_id = #{warehouseId}</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="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> <if test="createByName != null and createByName != ''"> and t3.user_name like concat('%', #{createByName}, '%')</if>
<if test="(params.beginCreateTime != null and params.beginCreateTime != '') or (params.endCreateTime != null and params.endCreateTime!='')">
<choose>
<when test="(params.beginCreateTime != null and params.beginCreateTime != '') and (params.endCreateTime != null and params.endCreateTime!='')">
and t1.create_time between date_format(#{params.beginCreateTime}, '%Y-%m-%d 00:00:00') and
date_format(#{params.endCreateTime}, '%Y-%m-%d 23:59:59')
</when>
<when test="(params.beginCreateTime != null and params.beginCreateTime != '')">
and t1.create_time <![CDATA[ >= ]]> date_format(#{params.beginCreateTime}, '%Y-%m-%d 00:00:00')
</when>
<when test="(params.endCreateTime != null and params.endCreateTime!='')">
and t1.create_time <![CDATA[ <= ]]> date_format(#{params.endCreateTime}, '%Y-%m-%d 23:59:59')
</when>
</choose>
</if>
</where> </where>
</select> </select>

View File

@ -68,44 +68,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProjectOrderInfoList" parameterType="ProjectOrderInfo" resultMap="ProjectOrderInfoResult"> <select id="selectProjectOrderInfoList" parameterType="ProjectOrderInfo" resultMap="ProjectOrderInfoResult">
<include refid="selectProjectOrderInfoRelationVo"/> <include refid="selectProjectOrderInfoRelationVo"/>
<where> <where>
<if test="projectId != null "> and t1.project_id = #{projectId}</if> <if test="projectId != null ">and t1.project_id = #{projectId}</if>
<if test="projectCode != null and projectCode!='' "> and t2.project_code like concat('%',#{projectCode},'%')</if> <if test="projectCode != null and projectCode!='' ">and t2.project_code like
<if test="projectName != null and projectName!=''"> and t2.project_name like concat('%', #{projectName},'%')</if> concat('%',#{projectCode},'%')
<if test="customerName != null and customerName!=''"> and t2.customer_name like concat('%',#{customerName},'%')</if> </if>
<if test="agentName != null and agentName!=''"> and t4.agent_name like concat('%',#{agentName},'%')</if> <if test="projectName != null and projectName!=''">and t2.project_name like concat('%',
<if test="province != null and province != ''"> and t1.province = #{province}</if> #{projectName},'%')
<if test="city != null and city != ''"> and t1.city = #{city}</if> </if>
<if test="businessPerson != null and businessPerson != ''"> and t1.business_person = #{businessPerson}</if> <if test="customerName != null and customerName!=''">and t2.customer_name like
<if test="businessEmail != null and businessEmail != ''"> and t1.business_email = #{businessEmail}</if> concat('%',#{customerName},'%')
<if test="businessPhone != null and businessPhone != ''"> and t1.business_phone = #{businessPhone}</if> </if>
<if test="orderCode != null and orderCode != ''"> and t1.order_code = #{orderCode}</if> <if test="agentName != null and agentName!=''">and t4.agent_name like concat('%',#{agentName},'%')</if>
<if test="currencyType != null and currencyType != ''"> and t1.currencyType = #{currencyType}</if> <if test="province != null and province != ''">and t1.province = #{province}</if>
<if test="shipmentAmount != null "> and t1.shipment_amount = #{shipmentAmount}</if> <if test="city != null and city != ''">and t1.city = #{city}</if>
<if test="actualPurchaseAmount != null "> and t1.actual_purchase_amount = #{actualPurchaseAmount}</if> <if test="businessPerson != null and businessPerson != ''">and t1.business_person = #{businessPerson}</if>
<if test="orderEndTime != null "> and t1.order_end_time = #{orderEndTime}</if> <if test="businessEmail != null and businessEmail != ''">and t1.business_email = #{businessEmail}</if>
<if test="deliveryTime != null "> and t1.delivery_time = #{deliveryTime}</if> <if test="businessPhone != null and businessPhone != ''">and t1.business_phone = #{businessPhone}</if>
<if test="companyDelivery != null and companyDelivery != ''"> and t1.company_delivery = #{companyDelivery}</if> <if test="orderCode != null and orderCode != ''">and t1.order_code = #{orderCode}</if>
<if test="notifier != null and notifier != ''"> and t1.notifier = #{notifier}</if> <if test="currencyType != null and currencyType != ''">and t1.currencyType = #{currencyType}</if>
<if test="notifierEmail != null and notifierEmail != ''"> and t1.notifier_email = #{notifierEmail}</if> <if test="shipmentAmount != null ">and t1.shipment_amount = #{shipmentAmount}</if>
<if test="notifierPhone != null and notifierPhone != ''"> and t1.notifier_phone = #{notifierPhone}</if> <if test="actualPurchaseAmount != null ">and t1.actual_purchase_amount = #{actualPurchaseAmount}</if>
<if test="notifierAddress != null and notifierAddress != ''"> and t1.notifier_address = #{notifierAddress}</if> <if test="orderEndTime != null ">and t1.order_end_time = #{orderEndTime}</if>
<if test="duty != null and duty != ''"> and t1.duty = #{duty}</if> <if test="deliveryTime != null ">and t1.delivery_time = #{deliveryTime}</if>
<if test="dutyName != null and dutyName != ''"> and t5.user_name like concat('%', #{dutyName}, '%')</if> <if test="companyDelivery != null and companyDelivery != ''">and t1.company_delivery = #{companyDelivery}
<if test="dutyEmail != null and dutyEmail != ''"> and t1.duty_email = #{dutyEmail}</if> </if>
<if test="dutyPhone != null and dutyPhone != ''"> and t1.duty_phone = #{dutyPhone}</if> <if test="notifier != null and notifier != ''">and t1.notifier = #{notifier}</if>
<if test="orderChannel != null and orderChannel != ''"> and t1.order_channel = #{orderChannel}</if> <if test="notifierEmail != null and notifierEmail != ''">and t1.notifier_email = #{notifierEmail}</if>
<if test="partnerCode != null and partnerCode != ''"> and t1.partner_code = #{partnerCode}</if> <if test="notifierPhone != null and notifierPhone != ''">and t1.notifier_phone = #{notifierPhone}</if>
<if test="partnerName != null and partnerName != ''"> and t3.partner_name like concat('%', #{partnerName}, '%')</if> <if test="notifierAddress != null and notifierAddress != ''">and t1.notifier_address = #{notifierAddress}
<if test="supplier != null and supplier != ''"> and t1.supplier = #{supplier}</if> </if>
<if test="supplier != null and supplier != ''"> and t1.supplier = #{supplier}</if> <if test="duty != null and duty != ''">and t1.duty = #{duty}</if>
<if test="orderStatus != null and orderStatus != ''"> and t1.order_status = #{orderStatus}</if> <if test="dutyName != null and dutyName != ''">and t5.user_name like concat('%', #{dutyName}, '%')</if>
<if test="deliveryStatus != null and deliveryStatus != ''"> and t1.delivery_status = #{deliveryStatus}</if> <if test="dutyEmail != null and dutyEmail != ''">and t1.duty_email = #{dutyEmail}</if>
<if test="outerStatus != null and outerStatus != ''"> and t1.outer_status = #{outerStatus}</if> <if test="dutyPhone != null and dutyPhone != ''">and t1.duty_phone = #{dutyPhone}</if>
<if test="signStatus != null and signStatus != ''"> and t1.sign_status = #{signStatus}</if> <if test="orderChannel != null and orderChannel != ''">and t1.order_channel = #{orderChannel}</if>
<if test="partnerCode != null and partnerCode != ''">and t1.partner_code = #{partnerCode}</if>
<if test="partnerName != null and partnerName != ''">and t3.partner_name like concat('%', #{partnerName},
'%')
</if>
<if test="supplier != null and supplier != ''">and t1.supplier = #{supplier}</if>
<if test="supplier != null and supplier != ''">and t1.supplier = #{supplier}</if>
<if test="orderStatus != null and orderStatus != ''">and t1.order_status = #{orderStatus}</if>
<if test="deliveryStatus != null and deliveryStatus != ''">and t1.delivery_status = #{deliveryStatus}</if>
<if test="outerStatus != null and outerStatus != ''">and t1.outer_status = #{outerStatus}</if>
<if test="signStatus != null and signStatus != ''">and t1.sign_status = #{signStatus}</if>
<if test="deliveryTimeStart != null or deliveryTimeEnd != null"> <if test="deliveryTimeStart != null or deliveryTimeEnd != null">
<choose> <choose>
<when test="deliveryTimeStart != null and deliveryTimeEnd != null"> <when test="deliveryTimeStart != null and deliveryTimeEnd != null">
and t1.delivery_time between date_format(#{deliveryTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{deliveryTimeEnd}, '%Y-%m-%d 23:59:59') and t1.delivery_time between date_format(#{deliveryTimeStart}, '%Y-%m-%d 00:00:00') and
date_format(#{deliveryTimeEnd}, '%Y-%m-%d 23:59:59')
</when> </when>
<when test="deliveryTimeStart != null"> <when test="deliveryTimeStart != null">
and t1.delivery_time <![CDATA[ >= ]]> date_format(#{deliveryTimeStart}, '%Y-%m-%d 00:00:00') and t1.delivery_time <![CDATA[ >= ]]> date_format(#{deliveryTimeStart}, '%Y-%m-%d 00:00:00')
@ -119,7 +130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="approveTimeStart != null or approveTimeEnd != null"> <if test="approveTimeStart != null or approveTimeEnd != null">
<choose> <choose>
<when test="approveTimeStart != null and approveTimeEnd != null"> <when test="approveTimeStart != null and approveTimeEnd != null">
and t1.approve_time between date_format(#{approveTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{approveTimeEnd}, '%Y-%m-%d 23:59:59') and t1.approve_time between date_format(#{approveTimeStart}, '%Y-%m-%d 00:00:00') and
date_format(#{approveTimeEnd}, '%Y-%m-%d 23:59:59')
</when> </when>
<when test="deliveryTimeStart != null"> <when test="deliveryTimeStart != null">
and t1.approve_time <![CDATA[ >= ]]> date_format(#{approveTimeStart}, '%Y-%m-%d 00:00:00') and t1.approve_time <![CDATA[ >= ]]> date_format(#{approveTimeStart}, '%Y-%m-%d 00:00:00')
@ -133,13 +145,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="estimatedOrderTimeStart != null or estimatedOrderTimeEnd != null"> <if test="estimatedOrderTimeStart != null or estimatedOrderTimeEnd != null">
<choose> <choose>
<when test="estimatedOrderTimeStart != null and estimatedOrderTimeEnd != null"> <when test="estimatedOrderTimeStart != null and estimatedOrderTimeEnd != null">
and t2.estimated_order_time between date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59') and t2.estimated_order_time between date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00')
and date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
</when> </when>
<when test="estimatedOrderTimeStart != null"> <when test="estimatedOrderTimeStart != null">
and t2.estimated_order_time <![CDATA[ >= ]]> date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00') and t2.estimated_order_time <![CDATA[ >= ]]> date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d
00:00:00')
</when> </when>
<when test="estimatedOrderTimeEnd != null"> <when test="estimatedOrderTimeEnd != null">
and t2.estimated_order_time <![CDATA[ <= ]]> date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59') and t2.estimated_order_time <![CDATA[ <= ]]> date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d
23:59:59')
</when> </when>
</choose> </choose>
@ -147,7 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderEndTimeStart != null or orderEndTimeEnd != null"> <if test="orderEndTimeStart != null or orderEndTimeEnd != null">
<choose> <choose>
<when test="orderEndTimeStart != null and orderEndTimeEnd != null"> <when test="orderEndTimeStart != null and orderEndTimeEnd != null">
and t1.order_end_time between date_format(#{orderEndTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{orderEndTimeEnd}, '%Y-%m-%d 23:59:59') and t1.order_end_time between date_format(#{orderEndTimeStart}, '%Y-%m-%d 00:00:00') and
date_format(#{orderEndTimeEnd}, '%Y-%m-%d 23:59:59')
</when> </when>
<when test="orderEndTimeStart != null"> <when test="orderEndTimeStart != null">
and t1.order_end_time <![CDATA[ >= ]]> date_format(#{orderEndTimeStart}, '%Y-%m-%d 00:00:00') and t1.order_end_time <![CDATA[ >= ]]> date_format(#{orderEndTimeStart}, '%Y-%m-%d 00:00:00')
@ -158,7 +174,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</choose> </choose>
</if> </if>
<if test="approve!=null and approve!=''"> and t1.order_code in (select business_key from bu_todo where process_key in ('order_approve_online','order_approve_offline') and approve_user = #{approve} and task_name != '售前') </if> <if test="approve!=null and approve!=''">and t1.order_code in (select business_key from bu_todo where
process_key in ('order_approve_online','order_approve_offline') and approve_user = #{approve} and
task_name != '售前')
</if>
<if test="productCodeList!=null and productCodeList.size>0">
and t1.project_id in (select distinct t2.project_id from project_product_info t2 where t2.product_bom_code in
<foreach item="item" collection="productCodeList" separator="," open="(" close=")">
#{item}
</foreach>
)
</if>
</where> </where>
</select> </select>
@ -277,7 +303,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</insert> </insert>
<insert id="bakData"> <insert id="bakData">
insert into project_order_info_log select * from project_order_info where order_code=#{orderCode} insert into project_order_info_log(id,
project_id,
province,
city,
business_person,
business_email,
business_phone,
version_code,
order_code,
currencyType,
shipment_amount,
actual_purchase_amount,
order_end_time,
delivery_time,
company_delivery,
notifier,
notifier_email,
notifier_phone,
notifier_address,
duty,
duty_email,
duty_phone,
order_channel,
partner_user_name,
partner_phone,
partner_email,
partner_code,
supplier,
remark,
delivery_status,
sign_status,
outer_status,
approve_time,
order_status,
create_by,
create_time,
update_by,
update_time,
process_type,
process_template,
discount_fold)
select id,
project_id,
province,
city,
business_person,
business_email,
business_phone,
version_code,
order_code,
currencyType,
shipment_amount,
actual_purchase_amount,
order_end_time,
delivery_time,
company_delivery,
notifier,
notifier_email,
notifier_phone,
notifier_address,
duty,
duty_email,
duty_phone,
order_channel,
partner_user_name,
partner_phone,
partner_email,
partner_code,
supplier,
remark,
delivery_status,
sign_status,
outer_status,
approve_time,
order_status,
create_by,
create_time,
update_by,
update_time,
process_type,
process_template,
discount_fold
from project_order_info
where order_code = #{orderCode}
</insert> </insert>
<update id="updateProjectOrderInfo" parameterType="ProjectOrderInfo"> <update id="updateProjectOrderInfo" parameterType="ProjectOrderInfo">
@ -315,6 +424,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supplier != null">supplier = #{supplier},</if> <if test="supplier != null">supplier = #{supplier},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if> <if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="outerStatus != null">outer_status = #{outerStatus},</if>
<if test="deliveryStatus != null">delivery_status = #{deliveryStatus},</if>
<if test="signStatus != null">sign_status = #{signStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>

View File

@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<sql id="selectProjectProductRelationInfoVo"> <sql id="selectProjectProductRelationInfoVo">
select t1.id, t1.project_id, t1.product_bom_code, t1.model, t1.product_code, t1.product_desc, t1.quantity, t1.catalogue_price, select t1.id, t1.project_id, t1.product_bom_code, t1.model, t1.product_code, t1.product_desc, t1.quantity, t1.catalogue_price,
t1.catalogue_all_price, t1.price, t1.all_price, t1.guidance_discount, t1.discount, t1.remark,t2.type,t2.product_name t1.catalogue_all_price, t1.price, t1.all_price, t1.guidance_discount, t1.discount, t1.remark,t2.type,t2.product_name,t2.vendor_code
from project_product_info t1 from project_product_info t1
left join product_info t2 on t1.product_bom_code = t2.product_code left join product_info t2 on t1.product_bom_code = t2.product_code

View File

@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectPartnerInfoVo"> <sql id="selectPartnerInfoVo">
select id, partner_code, partner_name, province, city, address, contact_person, contact_phone, level, create_at, update_at, delete_at, status from partner_info select id, partner_code, partner_name, contact_email,province, city, address, contact_person, contact_phone, level, create_at, update_at, delete_at, status from partner_info
</sql> </sql>
<select id="selectPartnerInfoList" parameterType="PartnerInfo" resultMap="PartnerInfoResult"> <select id="selectPartnerInfoList" parameterType="PartnerInfo" resultMap="PartnerInfoResult">
@ -43,6 +43,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) from partner_info where partner_code = #{partnerCode} and status=0 select count(1) from partner_info where partner_code = #{partnerCode} and status=0
<if test="id != null">and id != #{id}</if> <if test="id != null">and id != #{id}</if>
</select> </select>
<select id="listByOrderCode" resultType="com.ruoyi.sip.domain.PartnerInfo">
<include refid="selectPartnerInfoVo"/>
where partner_code IN (
SELECT
t2.partner_code
FROM
project_order_info t1
INNER JOIN project_info t2 ON t1.project_id = t2.id
where t1.order_code in
<foreach collection="list" index="index" open="(" close=")" item="item" separator=",">
#{item}
</foreach>
)
</select>
<insert id="insertPartnerInfo" parameterType="PartnerInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertPartnerInfo" parameterType="PartnerInfo" useGeneratedKeys="true" keyProperty="id">
insert into partner_info insert into partner_info
@ -54,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">address,</if> <if test="address != null">address,</if>
<if test="contactPerson != null">contact_person,</if> <if test="contactPerson != null">contact_person,</if>
<if test="contactPhone != null">contact_phone,</if> <if test="contactPhone != null">contact_phone,</if>
<if test="contactEmail != null">contact_email,</if>
<if test="level != null">level,</if> <if test="level != null">level,</if>
<if test="createAt != null">create_at,</if> <if test="createAt != null">create_at,</if>
<if test="updateAt != null">update_at,</if> <if test="updateAt != null">update_at,</if>
@ -69,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">#{address},</if> <if test="address != null">#{address},</if>
<if test="contactPerson != null">#{contactPerson},</if> <if test="contactPerson != null">#{contactPerson},</if>
<if test="contactPhone != null">#{contactPhone},</if> <if test="contactPhone != null">#{contactPhone},</if>
<if test="contactEmail != null">#{contactEmail},</if>
<if test="level != null">#{level},</if> <if test="level != null">#{level},</if>
<if test="createAt != null">#{createAt},</if> <if test="createAt != null">#{createAt},</if>
<if test="updateAt != null">#{updateAt},</if> <if test="updateAt != null">#{updateAt},</if>
@ -86,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="province != null">province = #{province},</if> <if test="province != null">province = #{province},</if>
<if test="city != null">city = #{city},</if> <if test="city != null">city = #{city},</if>
<if test="address != null">address = #{address},</if> <if test="address != null">address = #{address},</if>
<if test="contactEmail != null">contact_email=#{contactEmail},</if>
<if test="contactPerson != null">contact_person = #{contactPerson},</if> <if test="contactPerson != null">contact_person = #{contactPerson},</if>
<if test="contactPhone != null">contact_phone = #{contactPhone},</if> <if test="contactPhone != null">contact_phone = #{contactPhone},</if>
<if test="level != null">level = #{level},</if> <if test="level != null">level = #{level},</if>

View File

@ -31,6 +31,11 @@
<where> <where>
and t1.status = 0 and t1.status = 0
<if test="productCode != null and productCode != ''"> and t1.product_code like concat('%', #{productCode}, '%')</if> <if test="productCode != null and productCode != ''"> and t1.product_code like concat('%', #{productCode}, '%')</if>
<if test="productCodeList != null and productCodeList.size>0 ">and t1.product_code in
<foreach item="item" index="index" collection="productCodeList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="productName != null and productName != ''"> and t1.product_name like concat('%', #{productName}, '%')</if> <if test="productName != null and productName != ''"> and t1.product_name like concat('%', #{productName}, '%')</if>
<if test="model != null and model != ''"> and t1.model like concat('%', #{model}, '%')</if> <if test="model != null and model != ''"> and t1.model like concat('%', #{model}, '%')</if>
<if test="type != null and type != ''"> and find_in_set(t1.type , #{type})</if> <if test="type != null and type != ''"> and find_in_set(t1.type , #{type})</if>
@ -94,6 +99,17 @@
and id!=#{id} and id!=#{id}
</if> </if>
</select> </select>
<select id="authProductCode" resultType="java.lang.String">
select product_code from product_info t1 inner join oms_vendor_info t2 on t1.vendor_code=t2.vendor_code
<where>
<if test="vendorNameList != null and vendorNameList.size>0">
and t2.vendor_name in
<foreach item="item" index="index" collection="vendorNameList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
<insert id="insertProductInfo" parameterType="ProductInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertProductInfo" parameterType="ProductInfo" useGeneratedKeys="true" keyProperty="id">

View File

@ -28,14 +28,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOmsWarehouseInfoList" parameterType="OmsWarehouseInfo" resultMap="OmsWarehouseInfoResult"> <select id="selectOmsWarehouseInfoList" parameterType="OmsWarehouseInfo" resultMap="OmsWarehouseInfoResult">
<include refid="selectOmsWarehouseInfoVo"/> <include refid="selectOmsWarehouseInfoVo"/>
<where> <where>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if> warehouse_status = '0'
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if> <if test="warehouseName != null and warehouseName != ''">and warehouse_name like concat('%',
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if> #{warehouseName}, '%')
<if test="warehouseStatus != null and warehouseStatus != ''"> and warehouse_status = #{warehouseStatus}</if> </if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="warehouseNameList != null and warehouseNameList.size>0">and warehouse_name in (<foreach
<if test="managerName != null and managerName != ''"> and manager_name like concat('%', #{managerName}, '%')</if> item="item" collection="warehouseNameList" separator=",">#{item}</foreach>)
<if test="managerPhone != null and managerPhone != ''"> and manager_phone = #{managerPhone}</if> </if>
<if test="managerEmail != null and managerEmail != ''"> and manager_email = #{managerEmail}</if> <if test="idList != null and idList.size>0">and id in (<foreach item="item" collection="idList"
separator=",">#{item}</foreach>)
</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="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> </where>
</select> </select>
@ -59,6 +69,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item} #{item}
</foreach> </foreach>
</select> </select>
<select id="listAll" resultType="com.ruoyi.sip.domain.OmsWarehouseInfo">
<include refid="selectOmsWarehouseInfoVo"/>
<where>
<if test="warehouseName != null and warehouseName != ''">and warehouse_name like concat('%',
#{warehouseName}, '%')
</if>
<if test="warehouseNameList != null and warehouseNameList.size>0">and warehouse_name in (<foreach
item="item" collection="warehouseNameList" separator=",">#{item}</foreach>)
</if>
<if test="idList != null and idList.size>0">and id in (<foreach item="item" collection="idList"
separator=",">#{item}</foreach>)
</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>
<insert id="insertOmsWarehouseInfo" parameterType="OmsWarehouseInfo"> <insert id="insertOmsWarehouseInfo" parameterType="OmsWarehouseInfo">
insert into oms_warehouse_info insert into oms_warehouse_info

View File

@ -211,4 +211,6 @@ public interface ISysUserService
* @return * @return
*/ */
public int changeStatus(SysUser user); public int changeStatus(SysUser user);
List<SysUser> listByRoleId(String l);
} }

View File

@ -1,6 +1,7 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.validation.ConstraintViolationException; import javax.validation.ConstraintViolationException;
@ -565,4 +566,9 @@ public class SysUserServiceImpl implements ISysUserService
{ {
return userMapper.updateUser(user); return userMapper.updateUser(user);
} }
@Override
public List<SysUser> listByRoleId(String roleId) {
return userMapper.listUserByRoleId(roleId);
}
} }