feat(inventory): 添加库存权限控制功能
- 新增 IInventoryAuthService 接口及实现类,用于获取当前用户权限范围内的制造商、产品编码和仓库信息 - 在 InventoryDelivery 和 InventoryInfo 类中添加 productCodeList 字段,用于存储权限范围内的产品编码列表 - 修改 InventoryDeliveryController 和 InventoryExecutionController,增加权限控制逻辑 - 更新相关模板文件,调整UI布局和显示逻辑以适应新功能dev_1.0.0
parent
0aa2f518fc
commit
258ee495b1
|
|
@ -152,8 +152,12 @@ process:
|
|||
orderApproveOffline:
|
||||
beanName: projectOrderInfoServiceImpl
|
||||
unis:
|
||||
inventory:
|
||||
allAuthRole: 103
|
||||
order:
|
||||
# 执行单截止时间
|
||||
endHour: 96
|
||||
mail:
|
||||
enabled: true
|
||||
# 商务角色id
|
||||
businessRoleId: 103
|
||||
|
|
@ -358,42 +358,24 @@
|
|||
<span>生成出库单</span>
|
||||
</div>
|
||||
<form class="form-horizontal m" id="generateOuterForm">
|
||||
<div class="col-xs-4">
|
||||
<input type="hidden" name="orderCode" th:value="${projectOrderInfo.orderCode}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ">出库单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input placeholder="自动生成" id="outerCode" class="form-control" type="text" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ">出库时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input placeholder="自动生成" id="outerTime" class="form-control" type="text" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<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 class="col-xs-12">
|
||||
<table>
|
||||
<tr>
|
||||
<td>出库单号:</td>
|
||||
<td><input placeholder="自动生成" id="outerCode" class="form-control" type="text" readonly></td>
|
||||
<td>出库时间:</td>
|
||||
<td colspan="3"><input placeholder="自动生成" id="outerTime" class="form-control" type="text"
|
||||
readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>产品编码</td>
|
||||
<td><input id="outer-productCode" name="productCode" class="form-control" type="text" readonly></td>
|
||||
<td>产品型号:</td>
|
||||
<td><input id="outer-model" class="form-control" type="text" readonly></td>
|
||||
<td>制造商:</td>
|
||||
<td><input id="outer-vendorName" class="form-control" type="text" readonly></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-xs-12 section-title" >
|
||||
<span>仓库信息</span>
|
||||
|
|
|
|||
|
|
@ -118,7 +118,9 @@
|
|||
</form>
|
||||
</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">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
|
|
@ -155,6 +157,58 @@
|
|||
$.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 () {
|
||||
// $('#content').load(ctx + 'project/order/add');
|
||||
var urlChina = '/cnarea/select';
|
||||
|
|
@ -255,9 +309,14 @@
|
|||
width: 200,
|
||||
formatter: function (value, row, index) {
|
||||
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="viewDetail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
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> ');
|
||||
if (row.signStatus == '0' && row.deliveryStatus=='2') {
|
||||
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('');
|
||||
}
|
||||
}]
|
||||
|
|
@ -304,6 +363,7 @@
|
|||
});
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -35,20 +35,20 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="inventory:info:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="inventory:info:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="inventory:info:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="inventory:info:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
|
||||
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="inventory:info:add">-->
|
||||
<!-- <i class="fa fa-plus"></i> 添加-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="inventory:info:edit">-->
|
||||
<!-- <i class="fa fa-edit"></i> 修改-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="inventory:info:remove">-->
|
||||
<!-- <i class="fa fa-remove"></i> 删除-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="inventory:info:export">-->
|
||||
<!-- <i class="fa fa-download"></i> 导出-->
|
||||
<!-- </a>-->
|
||||
<!-- </div>-->
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="showInnerLog(\''+row.productCode+'\')"><i class="fa fa-edit"></i>入库记录</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
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('');
|
||||
}
|
||||
}]
|
||||
|
|
@ -129,6 +129,10 @@
|
|||
var url = prefix + "/innerLog/" + productCode;
|
||||
$.modal.openFull("入库记录表", url);
|
||||
}
|
||||
function showOuterLog(productCode){
|
||||
var url = prefix + "/outerLog/" + productCode;
|
||||
$.modal.openFull("入库记录表", url);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -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>
|
||||
|
|
@ -27,8 +27,10 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-5 control-label is-required">制造商:</label>
|
||||
<div class="col-sm-7">
|
||||
<input name="vendorCode" class="form-control" type="hidden" >
|
||||
<input name="vendorName" class="form-control" type="text" readonly required placeholder="自动带入">
|
||||
<select name="vendorCode" class="form-control" th:with="type=${vendorList}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.vendorName}"
|
||||
th:value="${dict.vendorCode}" ></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -50,7 +52,7 @@
|
|||
</a>
|
||||
|
||||
<a class="btn btn-warning" onclick="importList()">
|
||||
导入模板
|
||||
导入
|
||||
</a>
|
||||
</div>
|
||||
<div class="btn-group-sm">
|
||||
|
|
@ -353,7 +355,7 @@ debugger
|
|||
|
||||
$(function () {
|
||||
initTable()
|
||||
getCurrentVendor()
|
||||
// getCurrentVendor()
|
||||
$('.fixed-table-toolbar').css('display', 'none')
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<label>经办人:</label>
|
||||
<input type="text" name="createBy"/>
|
||||
<input type="text" name="createByName"/>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>入库时间:</label>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,18 @@
|
|||
font-family: "微软雅黑", Arial, sans-serif; /* 统一字体 */
|
||||
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 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
|
@ -98,66 +109,45 @@
|
|||
|
||||
</div>
|
||||
<form class="form-horizontal m" id="generateDeliveryForm">
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">物流单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="logisticsCode" name="logisticsCode" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<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>
|
||||
<div class="col-xs-12">
|
||||
<table>
|
||||
<tr>
|
||||
<td>物流单号:</td>
|
||||
<td> <input id="logisticsCode" name="logisticsCode" class="form-control" type="text"></td>
|
||||
<td> 发货方式:</td>
|
||||
<td> <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}"
|
||||
th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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')}">
|
||||
</select></td>
|
||||
<td>物流公司:</td>
|
||||
<td> <select name="logisticsCompany" id="logisticsCompany" class="form-control"
|
||||
th:with="type=${@dict.getType('logistics_company')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||
th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ">发货人:</label>
|
||||
<div class="col-sm-8">
|
||||
<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()">
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> 发货人</td>
|
||||
<td> <input placeholder="自动生成" id="createByName" class="form-control" type="text" readonly></td>
|
||||
<td>发货时间:</td>
|
||||
<td> <select class="form-control" id="deliveryTimeType" name="deliveryTimeType"
|
||||
onchange="changeDeliveryTimeType()">
|
||||
<option value="0">立即发货</option>
|
||||
<option value="1">自定义</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<input name="deliveryTime" class="time-input form-control" id="deliveryTime" autocomplete="off"
|
||||
placeholder="要求发货时间"/>
|
||||
</div>
|
||||
</div>
|
||||
</select></td>
|
||||
<td colspan="2"> <input name="deliveryTime" class="time-input form-control" id="deliveryTime" autocomplete="off"
|
||||
placeholder="要求发货时间"/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<form id="query-product-sn">
|
||||
<input type="hidden" name="inventoryStatus" value="0">
|
||||
<input type="hidden" name="productCode">
|
||||
<input type="hidden" id="outCode" name="outerCode">
|
||||
<input type="hidden" name="warehouseId">
|
||||
</form>
|
||||
|
|
@ -177,6 +167,7 @@
|
|||
<th:block th:include="include :: footer"/>
|
||||
<th:block th:include="include :: datetimepicker-js"/>
|
||||
<script th:inline="javascript">
|
||||
var showExcelFlag = [[${@permission.hasPermi('inventory:outer:importExcel')}]];
|
||||
var prefix = ctx + "inventory/outer";
|
||||
var productPrefix = ctx + "inventory/info";
|
||||
var deliveryPrefix = ctx + "inventory/delivery";
|
||||
|
|
@ -205,6 +196,7 @@
|
|||
const file = event.target.files[0];
|
||||
let data = new FormData()
|
||||
data.append('file', file)
|
||||
data.append('productCode', $('[name="productCode"]').val())
|
||||
var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象
|
||||
xhr.open('POST', prefix + '/importData', true); // 设置请求类型和URL
|
||||
// 当请求完成时执行的回调函数
|
||||
|
|
@ -212,7 +204,7 @@
|
|||
let data = JSON.parse(res.currentTarget.response)
|
||||
if (data.code === 0) {
|
||||
$.modal.msgSuccess('上传成功');
|
||||
$.table.refreshOptions({data: data})
|
||||
$.table.search('query-product-sn', 'bootstrap-table')
|
||||
} else {
|
||||
top.layer.alert(data.msg || '导入失败', {
|
||||
icon: 2,
|
||||
|
|
@ -251,6 +243,7 @@
|
|||
autoclose: true
|
||||
});
|
||||
$(function () {
|
||||
$('#toolbar').addClass( showExcelFlag )
|
||||
if (showReturnFlag) {
|
||||
parent.$('.layui-layer-btn0').css('display', 'none')
|
||||
} else {
|
||||
|
|
@ -405,7 +398,7 @@
|
|||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
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('');
|
||||
}
|
||||
}]
|
||||
|
|
@ -413,13 +406,14 @@
|
|||
$.table.init(options);
|
||||
}
|
||||
|
||||
function checkDelivery(quantity, warehouseId) {
|
||||
function checkDelivery(quantity, warehouseId, productCode) {
|
||||
initModal()
|
||||
// $.table.set('bootstrap-table')
|
||||
let width = 1000, height = 700
|
||||
parent.$('.layui-layer-btn').css('display', 'none')
|
||||
parent.$('.layui-layer-setwin').css('display', 'none')
|
||||
$('[name="warehouseId"]').val(warehouseId)
|
||||
$('[name="productCode"]').val(productCode)
|
||||
$('[name="inventoryStatus"]').val(0)
|
||||
$('#query-product-sn [name="outerCode"]').val('')
|
||||
$.table.search('query-product-sn', 'bootstrap-table')
|
||||
|
|
@ -552,7 +546,7 @@
|
|||
var actions = [];
|
||||
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-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 {
|
||||
|
||||
|
|
@ -624,8 +618,8 @@
|
|||
})
|
||||
}
|
||||
|
||||
function updateStatus(id, outerCode, orderCode) {
|
||||
$.operate.post(deliveryPrefix + '/status', {id: id, outerCode: outerCode, orderCode: orderCode}, res => {
|
||||
function updateStatus(id, outerCode, orderCode,productCode) {
|
||||
$.operate.post(deliveryPrefix + '/status', {id: id, outerCode: outerCode, orderCode: orderCode,productCode:productCode}, res => {
|
||||
refreshTable();
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
function received(id) {
|
||||
$.modal.confirm("确认要确认接收吗?", function () {
|
||||
$.operate.post(prefix + "/status", {"id": id, "outerStatus": '3'},()=>{
|
||||
$.table.search()
|
||||
// $.table.search()
|
||||
});
|
||||
})
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
function refundable(id) {
|
||||
$.modal.confirm("确认要确认退回吗?", function () {
|
||||
$.operate.post(prefix + "/status", {"id": id, "outerStatus": '4'},()=>{
|
||||
$.table.search()
|
||||
// $.table.search()
|
||||
});
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -623,12 +623,7 @@
|
|||
s:[{
|
||||
n: '电子订单',
|
||||
v: '0'
|
||||
},
|
||||
{
|
||||
n: '纸质合同',
|
||||
v: '1'
|
||||
|
||||
}]
|
||||
}]
|
||||
},
|
||||
{
|
||||
n: '定制开发合同',
|
||||
|
|
|
|||
|
|
@ -56,12 +56,13 @@
|
|||
</div>
|
||||
<div class="col-xs-6">
|
||||
<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">
|
||||
<input name="address" class="form-control" type="text">
|
||||
<input name="contactEmail" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">联系人:</label>
|
||||
|
|
@ -78,7 +79,14 @@
|
|||
</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>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
|
|
|
|||
|
|
@ -58,12 +58,13 @@
|
|||
</div>
|
||||
<div class="col-xs-6">
|
||||
<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">
|
||||
<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 class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">联系人:</label>
|
||||
|
|
@ -80,7 +81,14 @@
|
|||
</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>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
.bootstrap-table table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
.word-warp{
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
|
|
@ -142,6 +145,12 @@
|
|||
width:100,
|
||||
field: 'contactPhone',
|
||||
title: '联系电话'
|
||||
},
|
||||
{
|
||||
width:100,
|
||||
class:'word-warp',
|
||||
field: 'contactEmail',
|
||||
title: '邮件'
|
||||
},
|
||||
{
|
||||
width:100,
|
||||
|
|
|
|||
|
|
@ -14,14 +14,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">仓库编码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="warehouseCode" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">类型:</label>
|
||||
|
|
|
|||
|
|
@ -23,16 +23,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="warehouseType" class="form-control" th:with="type=${@dict.getType('warehouse_type')}" required>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseType}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">状态:</label>
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@
|
|||
<label>仓库名称:</label>
|
||||
<input type="text" name="warehouseName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>仓库编码:</label>
|
||||
<input type="text" name="warehouseCode"/>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label>类型:</label>
|
||||
<select name="warehouseType" th:with="type=${@dict.getType('warehouse_type')}">
|
||||
|
|
@ -105,10 +102,6 @@
|
|||
field: 'warehouseName',
|
||||
title: '仓库名称'
|
||||
},
|
||||
{
|
||||
field: 'warehouseCode',
|
||||
title: '仓库编码'
|
||||
},
|
||||
{
|
||||
field: 'warehouseType',
|
||||
title: '类型',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.ruoyi.sip.controller;
|
||||
|
||||
import java.util.Collections;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -29,6 +33,8 @@ public class InventoryDeliveryController extends BaseController
|
|||
|
||||
@Autowired
|
||||
private IInventoryDeliveryService inventoryDeliveryService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("inventory:delivery:view")
|
||||
@GetMapping()
|
||||
|
|
@ -45,8 +51,16 @@ public class InventoryDeliveryController extends BaseController
|
|||
@ResponseBody
|
||||
public TableDataInfo list(InventoryDelivery inventoryDelivery)
|
||||
{
|
||||
startPage();
|
||||
|
||||
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);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public class InventoryExecutionController extends BaseController {
|
|||
private IProjectOrderInfoService orderInfoService;
|
||||
@Autowired
|
||||
private IExecutionTrackService service;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("inventory:inner:view")
|
||||
@GetMapping()
|
||||
|
|
@ -52,8 +54,17 @@ public class InventoryExecutionController extends BaseController {
|
|||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(ProjectOrderInfo projectOrderInfo) {
|
||||
startPage();
|
||||
|
||||
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);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.ruoyi.common.utils.ShiroUtils;
|
|||
import com.ruoyi.sip.domain.ProductInfo;
|
||||
import com.ruoyi.sip.domain.ProjectInfo;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IProductInfoService;
|
||||
import com.ruoyi.sip.service.IVendorInfoService;
|
||||
import liquibase.pro.packaged.A;
|
||||
|
|
@ -46,7 +47,7 @@ public class InventoryInfoController extends BaseController
|
|||
@Autowired
|
||||
private IProductInfoService productInfoService;
|
||||
@Autowired
|
||||
private IVendorInfoService vendorInfoService;
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("inventory:info:view")
|
||||
@GetMapping()
|
||||
|
|
@ -63,6 +64,14 @@ public class InventoryInfoController extends BaseController
|
|||
@ResponseBody
|
||||
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();
|
||||
List<InventoryInfo> list = inventoryInfoService.selectInventoryInfoList(inventoryInfo);
|
||||
return getDataTable(list);
|
||||
|
|
@ -71,14 +80,15 @@ public class InventoryInfoController extends BaseController
|
|||
@ResponseBody
|
||||
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();
|
||||
// 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);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -104,6 +114,7 @@ public class InventoryInfoController extends BaseController
|
|||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
|
|
@ -143,11 +154,18 @@ public class InventoryInfoController extends BaseController
|
|||
return toAjax(inventoryInfoService.updateInventoryInfo(inventoryInfo));
|
||||
}
|
||||
@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);
|
||||
return prefix + "/innerLog";
|
||||
}
|
||||
|
||||
@GetMapping("/outerLog/{productCode}")
|
||||
public String outerLog(@PathVariable("productCode") String productCode, ModelMap mmap) {
|
||||
|
||||
mmap.put("productCode", productCode);
|
||||
return prefix + "/outerLog";
|
||||
}
|
||||
/**
|
||||
* 删除产品库存
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,23 +1,27 @@
|
|||
package com.ruoyi.sip.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IOmsInventoryInnerService;
|
||||
import com.ruoyi.sip.vo.OuterDeliveryVo;
|
||||
import liquibase.pro.packaged.A;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
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.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 出库单Controller
|
||||
|
|
@ -41,6 +46,10 @@ public class InventoryOuterController extends BaseController
|
|||
|
||||
@Autowired
|
||||
private IInventoryOuterService inventoryOuterService;
|
||||
@Autowired
|
||||
private IOmsInventoryInnerService innerService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("inventory:outer:view")
|
||||
@GetMapping()
|
||||
|
|
@ -57,8 +66,16 @@ public class InventoryOuterController extends BaseController
|
|||
@ResponseBody
|
||||
public TableDataInfo list(InventoryOuter inventoryOuter)
|
||||
{
|
||||
startPage();
|
||||
|
||||
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);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -138,6 +155,29 @@ public class InventoryOuterController extends BaseController
|
|||
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();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改保存出库单
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ import java.io.IOException;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.sip.domain.InventoryInfo;
|
||||
import com.ruoyi.sip.domain.OmsWarehouseInfo;
|
||||
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IInventoryInfoService;
|
||||
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -42,6 +44,8 @@ public class OmsInventoryInnerController extends BaseController {
|
|||
private IInventoryInfoService inventoryInfoService;
|
||||
@Autowired
|
||||
private IOmsWarehouseInfoService warehouseInfoService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("inventory:inner:view")
|
||||
@GetMapping()
|
||||
|
|
@ -80,10 +84,11 @@ public class OmsInventoryInnerController extends BaseController {
|
|||
@RequiresPermissions("inventory:inner:add")
|
||||
@GetMapping("/add")
|
||||
public String add(ModelMap modelMap) {
|
||||
//仓库进行权限校验
|
||||
OmsWarehouseInfo queryWarehouseParam = new OmsWarehouseInfo();
|
||||
queryWarehouseParam.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
|
||||
modelMap.put("warehouseList", warehouseInfoService.selectOmsWarehouseInfoList(queryWarehouseParam));
|
||||
|
||||
modelMap.put("warehouseList", warehouseInfoService.listByAuth(queryWarehouseParam));
|
||||
modelMap.put("vendorList", inventoryAuthService.currentVendor());
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
|
|
@ -152,10 +157,15 @@ public class OmsInventoryInnerController extends BaseController {
|
|||
}
|
||||
@PostMapping("/importData")
|
||||
@ResponseBody
|
||||
public TableDataInfo importData(MultipartFile file) throws IOException {
|
||||
public Object importData(MultipartFile file) throws IOException {
|
||||
ExcelUtil<WarehouseInnerExcelDto> util = new ExcelUtil<WarehouseInnerExcelDto>(WarehouseInnerExcelDto.class);
|
||||
List<WarehouseInnerExcelDto> excelList = util.importExcel(file.getInputStream());
|
||||
List<InventoryInfo> inventoryInfos = inventoryInfoService.fillBaseInfo(excelList);
|
||||
List<InventoryInfo> inventoryInfos = null;
|
||||
try {
|
||||
inventoryInfos = inventoryInfoService.fillBaseInfo(excelList);
|
||||
} catch (ServiceException e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return getDataTable(inventoryInfos);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class OmsWarehouseInfoController extends BaseController
|
|||
public TableDataInfo list(OmsWarehouseInfo omsWarehouseInfo)
|
||||
{
|
||||
startPage();
|
||||
List<OmsWarehouseInfo> list = omsWarehouseInfoService.selectOmsWarehouseInfoList(omsWarehouseInfo);
|
||||
List<OmsWarehouseInfo> list = omsWarehouseInfoService.list(omsWarehouseInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ public class OmsWarehouseInfoController extends BaseController
|
|||
@ResponseBody
|
||||
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);
|
||||
return util.exportExcel(list, "仓库基础信息数据");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IVendorInfoService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -42,6 +43,8 @@ public class ProductInfoController extends BaseController
|
|||
|
||||
@Autowired
|
||||
private IVendorInfoService vendorInfoService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
@RequiresPermissions("system:product:view")
|
||||
@GetMapping()
|
||||
public String product()
|
||||
|
|
@ -66,6 +69,13 @@ public class ProductInfoController extends BaseController
|
|||
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));
|
||||
if (CollUtil.isEmpty(list)){
|
||||
return AjaxResult.error("未找到该产品");
|
||||
|
|
|
|||
|
|
@ -13,11 +13,13 @@ import java.util.Map;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.sip.domain.ProjectInfo;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.flowable.domain.Todo;
|
||||
import com.ruoyi.sip.flowable.service.TodoService;
|
||||
|
|
@ -299,6 +301,28 @@ public class ProjectOrderInfoController extends BaseController
|
|||
fileLogService.insertProjectOrderFileLog(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")
|
||||
@ResponseBody
|
||||
|
|
@ -361,6 +385,29 @@ public class ProjectOrderInfoController extends BaseController
|
|||
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")
|
||||
public ResponseEntity<ByteArrayResource> view(@RequestParam("filePath") String filePath, @RequestParam("fileName") String fileName, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.sip.domain.OmsWarehouseInfo;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -54,6 +55,8 @@ public class VendorInfoController extends BaseController
|
|||
private IVendorInfoService vendorInfoService;
|
||||
@Autowired
|
||||
private IOmsWarehouseInfoService warehouseInfoService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("system:vendor:view")
|
||||
@GetMapping()
|
||||
|
|
@ -180,7 +183,7 @@ public class VendorInfoController extends BaseController
|
|||
@GetMapping("/current")
|
||||
@ResponseBody
|
||||
public AjaxResult current() {
|
||||
List<VendorInfo> vendorInfo = vendorInfoService.current();
|
||||
List<VendorInfo> vendorInfo = inventoryAuthService.currentVendor();
|
||||
if (CollUtil.isEmpty(vendorInfo)) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public class InventoryDelivery extends BaseEntity
|
|||
private String projectName;
|
||||
@Excel(name = "产品编码")
|
||||
private String productCode;
|
||||
private List<String> productCodeList;
|
||||
@Excel(name = "产品型号")
|
||||
private String model;
|
||||
@Excel(name = "发货数量")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
|
@ -28,6 +29,7 @@ public class InventoryInfo extends BaseEntity
|
|||
/** 产品编码 */
|
||||
@Excel(name = "产品编码")
|
||||
private String productCode;
|
||||
private List<String> productCodeList;
|
||||
private String model;
|
||||
private String productDesc;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public class InventoryOuter extends BaseEntity
|
|||
/** 出库单号 */
|
||||
@Excel(name = "出库单号")
|
||||
private String outerCode;
|
||||
|
||||
/** 发货时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "发货时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
|
|
@ -40,6 +41,7 @@ public class InventoryOuter extends BaseEntity
|
|||
/** 订单编码 */
|
||||
@Excel(name = "合同编号")
|
||||
private String orderCode;
|
||||
private String orderId;
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
/** 产品BOM编码 */
|
||||
|
|
@ -72,6 +74,7 @@ public class InventoryOuter extends BaseEntity
|
|||
/** 联系地址 */
|
||||
// @Excel(name = "联系地址")
|
||||
private String contactAddress;
|
||||
private String createByName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "生成时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
|
|
|
|||
|
|
@ -41,5 +41,6 @@ public class InventoryOuterDetail extends BaseEntity
|
|||
private Long availableCount;
|
||||
private String productCode;
|
||||
private String model;
|
||||
private String productName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
|
@ -46,6 +48,7 @@ public class OmsInventoryInner extends BaseEntity {
|
|||
@Excel(name = "制造商")
|
||||
private String vendorName;
|
||||
private String vendorCode;
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 仓库
|
||||
|
|
@ -56,6 +59,7 @@ public class OmsInventoryInner extends BaseEntity {
|
|||
private String warehouseName;
|
||||
@Excel(name = "经办人")
|
||||
private String createByName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "入库时间",dateFormat="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库基础信息对象 oms_warehouse_info
|
||||
*
|
||||
|
|
@ -20,10 +22,12 @@ public class OmsWarehouseInfo extends BaseEntity
|
|||
|
||||
/** */
|
||||
private Long id;
|
||||
private List<Long> idList;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
private List<String> warehouseNameList;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package com.ruoyi.sip.domain;
|
|||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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.core.domain.BaseEntity;
|
||||
|
||||
|
|
@ -54,6 +52,7 @@ public class PartnerInfo extends BaseEntity
|
|||
@Excel(name = "认证级别")
|
||||
private String level;
|
||||
private String levelName;
|
||||
private String contactEmail;
|
||||
|
||||
/** */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -28,6 +30,7 @@ public class ProductInfo extends BaseEntity
|
|||
/** 产品编码 */
|
||||
@Excel(name = "产品编码")
|
||||
private String productCode;
|
||||
private List<String> productCodeList;
|
||||
@Excel(name = "华智编码")
|
||||
private String hzCode;
|
||||
private String type;
|
||||
|
|
@ -61,6 +64,7 @@ public class ProductInfo extends BaseEntity
|
|||
private Date deletedAt;
|
||||
private String serialNumber;
|
||||
private String vendorCode;
|
||||
private List<String> vendorCodeList;
|
||||
private String vendorName;
|
||||
private Long availableCount;
|
||||
private Long cumulativeCount;
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public class ProjectOrderFileLog extends BaseEntity
|
|||
CONFIG("1","配置器"),
|
||||
CONTRACT("2","合同"),
|
||||
CONTRACT_BAK("3","合同备份文件"),
|
||||
SIGN("4","订单签收"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ public class ProjectOrderInfo extends BaseEntity {
|
|||
@Excel(name = "进货商")
|
||||
private String partnerName;
|
||||
private String projectPartnerName;
|
||||
private List<String> productCodeList;
|
||||
|
||||
/**
|
||||
* 实际进货金额
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ public class ProjectProductInfo extends BaseEntity
|
|||
/** 指导折扣 */
|
||||
// @Excel(name = "指导折扣")
|
||||
private BigDecimal guidanceDiscount;
|
||||
private String vendorCode;
|
||||
|
||||
/** 折扣 */
|
||||
// @Excel(name = "折扣")
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class WarehouseInnerExcelDto {
|
|||
private String productCode;
|
||||
@Excel(name="入库价(含税)")
|
||||
private BigDecimal innerPrice;
|
||||
@Excel(name="入库仓")
|
||||
@Excel(name="仓库")
|
||||
private String warehouseName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,4 +66,6 @@ public interface InventoryInfoMapper
|
|||
List<ProductWarehouseInfo> checkOurPreview(List<String> productCodeList);
|
||||
|
||||
void clearOutInfo(List<Long> idList);
|
||||
|
||||
List<InventoryInfo> countBySn(List<String> productSnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,5 @@ public interface InventoryOuterDetailMapper
|
|||
void deleteByOuterCode(List<String> outerCode);
|
||||
|
||||
|
||||
List<InventoryOuterDetail> listMailDataByOuterId(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.sip.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.InventoryOuter;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
|
||||
/**
|
||||
* 出库单Mapper接口
|
||||
|
|
@ -63,4 +64,6 @@ public interface InventoryOuterMapper
|
|||
int selectMaxOrderCode(String string);
|
||||
|
||||
int countByOrderCode(String orderCode);
|
||||
|
||||
String selectVendorById(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.sip.mapper;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.OmsWarehouseInfo;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
|
@ -64,4 +65,8 @@ public interface OmsWarehouseInfoMapper
|
|||
List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList);
|
||||
|
||||
List<OmsWarehouseInfo> listByIds(@Param("list") Collection<String> warehouseSet);
|
||||
|
||||
List<OmsWarehouseInfo> listAll(OmsWarehouseInfo omsWarehouseInfo);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,5 @@ public interface PartnerInfoMapper
|
|||
public int deletePartnerInfoByIds(String[] ids);
|
||||
public int selectCountByCode(PartnerInfo partnerInfo);
|
||||
|
||||
List<PartnerInfo> listByOrderCode(List<String> orderCodeList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
|
||||
import com.ruoyi.sip.domain.ProductInfo;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
|
@ -72,4 +73,6 @@ public interface ProductInfoMapper
|
|||
|
||||
void updateAvailableCount(@Param("quantity") Long quantity, @Param("productCode") String productCode);
|
||||
void updateCumulativeCount(@Param("quantity") Long quantity, @Param("productCode") String productCode);
|
||||
|
||||
List<String> authProductCode(VendorInfo productInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -76,4 +76,6 @@ public interface IInventoryInfoService
|
|||
List<ProductWarehouseInfo> checkOurPreview(List<String> productCode);
|
||||
|
||||
void clearOutInfo(List<Long> collect);
|
||||
|
||||
List<String> checkUnq(List<String> productSnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@ package com.ruoyi.sip.service;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.sip.domain.InventoryInfo;
|
||||
import com.ruoyi.sip.domain.OmsInventoryInner;
|
||||
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
|
||||
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
||||
|
||||
/**
|
||||
* 入库单信息Service接口
|
||||
|
|
@ -63,4 +62,5 @@ public interface IOmsInventoryInnerService
|
|||
public int deleteOmsInventoryInnerById(Long id);
|
||||
|
||||
|
||||
void importByOuter(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,13 @@ public interface IOmsWarehouseInfoService
|
|||
* @return 仓库基础信息集合
|
||||
*/
|
||||
public List<OmsWarehouseInfo> selectOmsWarehouseInfoList(OmsWarehouseInfo omsWarehouseInfo);
|
||||
/**
|
||||
* 查询仓库基础信息列表
|
||||
*
|
||||
* @param omsWarehouseInfo 仓库基础信息
|
||||
* @return 仓库基础信息集合
|
||||
*/
|
||||
public List<OmsWarehouseInfo> listByAuth(OmsWarehouseInfo omsWarehouseInfo);
|
||||
|
||||
/**
|
||||
* 新增仓库基础信息
|
||||
|
|
@ -68,7 +75,12 @@ public interface IOmsWarehouseInfoService
|
|||
* @param warehouseNameList
|
||||
* @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> list(OmsWarehouseInfo omsWarehouseInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,5 @@ public interface IPartnerInfoService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deletePartnerInfoById(Long id);
|
||||
public List<PartnerInfo> listByOrderCode(List<String> orderCodeList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,4 +65,6 @@ public interface IProductInfoService
|
|||
List<ProductInfo> selectProductInfoByCodeList(List<String> productCodeList);
|
||||
|
||||
void updateAvailableCount(Long quantity, String productCode);
|
||||
|
||||
void updateCumulativeCount(Long outerSum,String productCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,5 +82,8 @@ public interface IProjectOrderInfoService
|
|||
ProjectOrderInfo selectProjectOrderInfoByOrderCode(String orderCode);
|
||||
public List<ProjectOrderFileLog> getProjectOrderFileLogs();
|
||||
void approveOrder(Todo todo);
|
||||
|
||||
void sign(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
// Boolean foldOnFold(ProjectOrderInfo info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,6 @@ public interface IVendorInfoService
|
|||
*/
|
||||
public int deleteVendorInfoByVendorId(Long vendorId);
|
||||
|
||||
List<VendorInfo> current();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -46,10 +43,14 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
|
|||
private IInventoryOuterService outerService;
|
||||
@Autowired
|
||||
private IVendorInfoService vendorInfoService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@Override
|
||||
public ExecutionOrderVo selectInfo(Long id) {
|
||||
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);
|
||||
vo.setProjectOrderInfo(projectOrderInfo);
|
||||
|
|
@ -59,6 +60,7 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
|
|||
List<ProductDetail> productDetails = projectProductInfos.stream()
|
||||
.filter(item -> item.getType().equals(ProductInfo.ProductTypeEnum.HARDWARE.getType()) ||
|
||||
item.getType().equals(ProductInfo.ProductTypeEnum.SOFTWARE.getType()))
|
||||
.filter(item -> currentVendorCodeSet.contains(item.getVendorCode()))
|
||||
.collect(Collectors.groupingBy(ProjectProductInfo::getProductBomCode))
|
||||
.entrySet().stream()
|
||||
.map(entry -> {
|
||||
|
|
@ -110,6 +112,9 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
|
|||
// 查询出库单信息
|
||||
InventoryOuter inventoryOuter = new InventoryOuter();
|
||||
inventoryOuter.setOrderCode(projectOrderInfo.getOrderCode());
|
||||
//只查询产品信息里面内容
|
||||
inventoryOuter.setProductCodeList(productCodeList);
|
||||
|
||||
List<InventoryOuter> inventoryOuters = outerService.selectInventoryOuterList(inventoryOuter);
|
||||
vo.setInventoryOuterList(inventoryOuters);
|
||||
// 根据出库单状态设置generatedQuantity和confirmQuantity
|
||||
|
|
@ -177,7 +182,7 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService {
|
|||
}
|
||||
// 如果仍有未满足的需求,尝试使用默认仓库
|
||||
if (remainingQuantity > 0) {
|
||||
List<VendorInfo> currentVendors = vendorInfoService.current();
|
||||
List<VendorInfo> currentVendors = inventoryAuthService.currentVendor();
|
||||
if (CollUtil.isNotEmpty(currentVendors)) {
|
||||
VendorInfo defaultVendor = currentVendors.get(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
|
|
@ -40,6 +40,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
private IProjectProductInfoService projectProductInfoService;
|
||||
@Autowired
|
||||
private IProjectOrderInfoService projectOrderInfoService;
|
||||
@Autowired
|
||||
private IProductInfoService productInfoService;
|
||||
|
||||
/**
|
||||
* 查询产品库存
|
||||
|
|
@ -160,6 +162,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
updateOrder.setUpdateBy(ShiroUtils.getUserId().toString());
|
||||
updateOrder.setDeliveryStatus(sum == allSum ? ProjectOrderInfo.DeliveryStatusEnum.ALL_DELIVERY.getCode() : ProjectOrderInfo.DeliveryStatusEnum.PART_DELIVERY.getCode());
|
||||
projectOrderInfoService.updateProjectOrderInfoByCode(updateOrder);
|
||||
//修改累计发货数量
|
||||
productInfoService.updateCumulativeCount(outerSum, inventoryDelivery.getProductCode());
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.sip.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
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.warehouse.WarehouseInnerExcelDto;
|
||||
import com.ruoyi.sip.mapper.InventoryInfoMapper;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IInventoryInfoService;
|
||||
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
|
||||
import com.ruoyi.sip.service.IProductInfoService;
|
||||
import liquibase.pro.packaged.O;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -37,6 +40,8 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
|
|||
private IProductInfoService productInfoService;
|
||||
@Autowired
|
||||
private IOmsWarehouseInfoService warehouseInfoService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
/**
|
||||
* 查询产品库存
|
||||
|
|
@ -112,8 +117,9 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<String> authProductCodeList = inventoryAuthService.authProductCode();
|
||||
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);
|
||||
Map<String, ProductInfo> productInfoMap = productInfos.stream()
|
||||
.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.setProductCode(excel.getProductCode());
|
||||
inventoryInfo.setProductSn(excel.getProductSn());
|
||||
if (excel.getInnerPrice()==null){
|
||||
throw new ServiceException("入库价未填写,导入失败");
|
||||
}
|
||||
inventoryInfo.setInnerPrice(excel.getInnerPrice());
|
||||
if (warehouseInfoMap.containsKey(excel.getWarehouseName())){
|
||||
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(excel.getWarehouseName());
|
||||
inventoryInfo.setWarehouseId(omsWarehouseInfo.getId());
|
||||
inventoryInfo.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||
if (!warehouseInfoMap.containsKey(excel.getWarehouseName())) {
|
||||
throw new ServiceException("仓库未找到,导入失败");
|
||||
}
|
||||
|
||||
if (productInfoMap.containsKey(excel.getProductCode())){
|
||||
ProductInfo productInfo = productInfoMap.get(excel.getProductCode());
|
||||
inventoryInfo.setModel(productInfo.getModel());
|
||||
inventoryInfo.setProductDesc(productInfo.getDescription());
|
||||
inventoryInfo.setProductCode(productInfo.getProductCode());
|
||||
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(excel.getWarehouseName());
|
||||
inventoryInfo.setWarehouseId(omsWarehouseInfo.getId());
|
||||
inventoryInfo.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||
if (!productInfoMap.containsKey(excel.getProductCode())) {
|
||||
throw new ServiceException("产品未找到,导入失败");
|
||||
}
|
||||
ProductInfo productInfo = productInfoMap.get(excel.getProductCode());
|
||||
inventoryInfo.setModel(productInfo.getModel());
|
||||
inventoryInfo.setProductDesc(productInfo.getDescription());
|
||||
inventoryInfo.setProductCode(productInfo.getProductCode());
|
||||
return inventoryInfo;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
|
@ -163,5 +173,14 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
|
|||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,21 +7,27 @@ import java.util.function.Function;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
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.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.domain.*;
|
||||
import com.ruoyi.sip.dto.inventory.ProductWarehouseInfo;
|
||||
import com.ruoyi.sip.mapper.InventoryOuterDetailMapper;
|
||||
import com.ruoyi.sip.service.*;
|
||||
import com.ruoyi.sip.utils.TemplateMailUtil;
|
||||
import com.ruoyi.sip.vo.OuterDeliveryProductVo;
|
||||
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.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.InventoryOuterMapper;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.annotation.ApplicationScope;
|
||||
|
||||
/**
|
||||
* 出库单Service业务层处理
|
||||
|
|
@ -31,11 +37,14 @@ import org.springframework.web.context.annotation.ApplicationScope;
|
|||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Slf4j
|
||||
public class InventoryOuterServiceImpl implements IInventoryOuterService
|
||||
{
|
||||
@Autowired
|
||||
private InventoryOuterMapper inventoryOuterMapper;
|
||||
|
||||
@Autowired
|
||||
private InventoryOuterDetailMapper inventoryOuterDetailMapper;
|
||||
@Autowired
|
||||
private IProjectOrderInfoService orderInfoService;
|
||||
@Autowired
|
||||
|
|
@ -46,6 +55,12 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
|
|||
private IInventoryDeliveryService deliveryService;
|
||||
@Autowired
|
||||
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) {
|
||||
projectOrderInfo.setOuterStatus(ProjectOrderInfo.OuterStatusEnum.NOT_OUTER.getCode());
|
||||
} else {
|
||||
|
||||
projectOrderInfo.setOuterStatus(count == sum ? ProjectOrderInfo.OuterStatusEnum.ALL_OUTER.getCode() : ProjectOrderInfo.OuterStatusEnum.PART_OUTER.getCode());
|
||||
}
|
||||
|
||||
}
|
||||
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);
|
||||
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
|
||||
public OuterDeliveryVo selectBaseInfoById(Long id) {
|
||||
OuterDeliveryVo outerDeliveryVo = new OuterDeliveryVo();
|
||||
|
|
|
|||
|
|
@ -1,26 +1,24 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.domain.InventoryInfo;
|
||||
import com.ruoyi.sip.domain.OmsWarehouseInfo;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import com.ruoyi.sip.service.IInventoryInfoService;
|
||||
import com.ruoyi.sip.service.IProductInfoService;
|
||||
import com.ruoyi.sip.service.IVendorInfoService;
|
||||
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
||||
import com.ruoyi.sip.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.OmsInventoryInnerMapper;
|
||||
import com.ruoyi.sip.domain.OmsInventoryInner;
|
||||
import com.ruoyi.sip.service.IOmsInventoryInnerService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -42,6 +40,10 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
private IVendorInfoService vendorInfoService;
|
||||
@Autowired
|
||||
private IProductInfoService productInfoService;
|
||||
@Autowired
|
||||
private IOmsWarehouseInfoService warehouseInfoService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
/**
|
||||
* 查询入库单信息
|
||||
|
|
@ -62,13 +64,13 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
*/
|
||||
@Override
|
||||
public List<OmsInventoryInner> selectOmsInventoryInnerList(OmsInventoryInner omsInventoryInner) {
|
||||
if (!ShiroUtils.getSysUser().isAdmin()){
|
||||
List<VendorInfo> current = vendorInfoService.current();
|
||||
if (CollUtil.isEmpty(current)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
omsInventoryInner.setVendorCode(current.get(0).getVendorCode());
|
||||
}
|
||||
if (!inventoryAuthService.authAll()){
|
||||
List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
|
||||
if (CollUtil.isEmpty(vendorInfos)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
omsInventoryInner.setVendorCode(vendorInfos.get(0).getVendorCode());
|
||||
}
|
||||
return omsInventoryInnerMapper.selectOmsInventoryInnerList(omsInventoryInner);
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +82,7 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
*/
|
||||
@Override
|
||||
public int insertOmsInventoryInner(OmsInventoryInner omsInventoryInner) {
|
||||
//生成出库单
|
||||
//生成入库单
|
||||
omsInventoryInner.setInnerCode(generateInnerCode());
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
omsInventoryInner.setCreateTime(nowDate);
|
||||
|
|
@ -106,6 +108,11 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
item.setCreateBy(currentUserId);
|
||||
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);
|
||||
productInfoService.updateAvailableCount(omsInventoryInner.getQuantity(),omsInventoryInner.getProductCode());
|
||||
return omsInventoryInnerMapper.insertOmsInventoryInner(omsInventoryInner);
|
||||
|
|
@ -154,5 +161,41 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,21 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
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.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.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.OmsWarehouseInfoMapper;
|
||||
import com.ruoyi.sip.domain.OmsWarehouseInfo;
|
||||
|
|
@ -26,7 +32,10 @@ import com.ruoyi.common.core.text.Convert;
|
|||
public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
|
||||
@Autowired
|
||||
private OmsWarehouseInfoMapper omsWarehouseInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private IVendorInfoService vendorInfoService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
/**
|
||||
* 查询仓库基础信息
|
||||
*
|
||||
|
|
@ -49,6 +58,18 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
|
|||
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) {
|
||||
OmsWarehouseInfo queryDto = new OmsWarehouseInfo();
|
||||
queryDto.setWarehouseCode(omsWarehouseInfo.getWarehouseCode());
|
||||
queryDto.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||
List<OmsWarehouseInfo> omsWarehouseInfos = omsWarehouseInfoMapper.selectOmsWarehouseInfoList(queryDto);
|
||||
//code查询记录为空直接保存
|
||||
if (CollUtil.isEmpty(omsWarehouseInfos)) {
|
||||
|
|
@ -73,12 +94,12 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
|
|||
}
|
||||
//是否新增
|
||||
if (omsWarehouseInfo.getId() == null) {
|
||||
throw new RuntimeException("仓库编码重复,保存失败");
|
||||
throw new RuntimeException("仓库名称重复,保存失败");
|
||||
}
|
||||
//编辑需剔除当前数据
|
||||
long count = omsWarehouseInfos.stream().filter(item -> !item.getId().equals(omsWarehouseInfo.getId())).count();
|
||||
if (count > 0) {
|
||||
throw new RuntimeException("仓库编码重复,保存失败");
|
||||
throw new RuntimeException("仓库名称重复,保存失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -119,10 +140,15 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList) {
|
||||
public List<OmsWarehouseInfo> listByNameList(List<String> warehouseNameList, Boolean auth) {
|
||||
if (CollUtil.isEmpty(warehouseNameList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (auth == null || auth) {
|
||||
OmsWarehouseInfo omsWarehouseInfo = new OmsWarehouseInfo();
|
||||
omsWarehouseInfo.setWarehouseNameList(warehouseNameList);
|
||||
return listByAuth(omsWarehouseInfo);
|
||||
}
|
||||
return omsWarehouseInfoMapper.listByNameList(warehouseNameList);
|
||||
}
|
||||
|
||||
|
|
@ -130,4 +156,9 @@ public class OmsWarehouseInfoServiceImpl implements IOmsWarehouseInfoService {
|
|||
public List<OmsWarehouseInfo> listByIds(Collection<String> warehouseSet) {
|
||||
return omsWarehouseInfoMapper.listByIds(warehouseSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OmsWarehouseInfo> list(OmsWarehouseInfo omsWarehouseInfo) {
|
||||
return omsWarehouseInfoMapper.listAll(omsWarehouseInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
|
|
@ -104,4 +105,9 @@ public class PartnerInfoServiceImpl implements IPartnerInfoService
|
|||
{
|
||||
return partnerInfoMapper.deletePartnerInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PartnerInfo> listByOrderCode(List<String> orderCodeList) {
|
||||
return partnerInfoMapper.listByOrderCode(orderCodeList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,20 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
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.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.ProductInfoMapper;
|
||||
import com.ruoyi.sip.domain.ProductInfo;
|
||||
|
|
@ -26,7 +32,10 @@ public class ProductInfoServiceImpl implements IProductInfoService
|
|||
{
|
||||
@Autowired
|
||||
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) {
|
||||
productInfoMapper.updateAvailableCount(quantity,productCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCumulativeCount(Long outerSum, String productCode) {
|
||||
productInfoMapper.updateCumulativeCount(outerSum, productCode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
|
@ -12,15 +9,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
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.metadata.CellData;
|
||||
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.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.sip.domain.*;
|
||||
import com.ruoyi.sip.flowable.domain.BuApproveConfig;
|
||||
import com.ruoyi.sip.flowable.domain.Todo;
|
||||
import com.ruoyi.sip.dto.HomepageQueryDto;
|
||||
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.TodoService;
|
||||
import com.ruoyi.sip.utils.TemplateMailUtil;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
|
|
@ -60,7 +47,6 @@ import org.flowable.engine.runtime.ProcessInstance;
|
|||
import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.ProjectOrderInfoMapper;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
|
@ -102,7 +88,9 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
@Autowired
|
||||
protected ManagementService managementService;
|
||||
@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> DEPLOY_SERVICES = Arrays.asList("8814A0BT");
|
||||
private static final List<String> WSS_LIST = Arrays.asList("3130A6LC");
|
||||
|
|
@ -118,6 +106,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
private IBuApproveConfigService approveConfigService;
|
||||
@Value("${unis.order.endHour:96}")
|
||||
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));
|
||||
}
|
||||
|
||||
@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
|
||||
// public Boolean foldOnFold(ProjectOrderInfo projectOrderInfo) {
|
||||
// if (projectOrderInfo == null) {
|
||||
|
|
@ -1031,16 +1030,17 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
projectOrderInfoMapper.bakData(projectOrderInfo);
|
||||
//修改产品数据
|
||||
// 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);
|
||||
|
|
@ -1056,20 +1056,16 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
return null;
|
||||
}
|
||||
|
||||
private void sendDeliveryMail(List<String> toEmail,ProjectOrderInfo projectOrderInfo){
|
||||
private void sendPartnerMail(List<String> toEmail, ProjectOrderInfo projectOrderInfo){
|
||||
if (CollUtil.isEmpty(toEmail)){
|
||||
log.info("发货邮件发送失败,收件人为空");
|
||||
return;
|
||||
}
|
||||
List<ProjectProductInfo> projectProductInfos = productInfoService.selectProjectProductInfoListByProjectId(Collections.singletonList(projectOrderInfo.getProjectId()));
|
||||
if (CollUtil.isEmpty(projectProductInfos)){
|
||||
log.info("发货邮件发送失败,产品信息为空");
|
||||
return;
|
||||
}
|
||||
String templateTile="{}-紫光汇智云桌面-{}-供应商通知发货单";
|
||||
String templateTile="{}-紫光汇智云桌面-{}-进供货执行通知";
|
||||
String title = StringUtils.format(templateTile, projectOrderInfo.getOrderCode(), projectOrderInfo.getProjectName());
|
||||
|
||||
TemplateMailUtil.sendTemplateMail(toEmail,title,
|
||||
TemplateMailUtil.MailTemplate.ORDER_DELIVERY,Dict.create().set("productList", projectProductInfos));
|
||||
TemplateMailUtil.MailTemplate.ORDER_PARTNER,Dict.create());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,14 +119,4 @@ public class VendorInfoServiceImpl implements IVendorInfoService {
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class TemplateMailUtil {
|
|||
*/
|
||||
public static void sendTemplateMail(List<String> toEmail, String title, MailTemplate path, Dict dict) {
|
||||
String enabled = SpringUtils.getProperty("unis.mail.enabled", "false");
|
||||
if (Boolean.getBoolean(enabled)) {
|
||||
if (!Boolean.getBoolean(enabled)) {
|
||||
log.warn("邮件发送开关未开启");
|
||||
return;
|
||||
}
|
||||
|
|
@ -73,6 +73,7 @@ public class TemplateMailUtil {
|
|||
* 发货单
|
||||
*/
|
||||
ORDER_DELIVERY("mailOrderDeliveryTemplate.html","供应商通知发货单"),
|
||||
ORDER_PARTNER("mailPartnerTemplate.html","代理商商通知"),
|
||||
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,17 +40,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectInventoryDeliveryList" parameterType="InventoryDelivery" resultMap="InventoryDeliveryResult">
|
||||
<include refid="selectInventoryDeliveryVo"/>
|
||||
<where>
|
||||
<if test="outerCode != null and outerCode != ''"> and t1.outer_code = #{outerCode}</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="deliveryStatus != null and deliveryStatus != ''"> and t1.delivery_status = #{deliveryStatus}</if>
|
||||
<if test="logisticsCode != null and logisticsCode != ''"> and t1.logistics_code = #{logisticsCode}</if>
|
||||
<if test="deliveryTimeType != null and deliveryTimeType != ''"> and t1.delivery_time_type = #{deliveryTimeType}</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="orderCode != null and orderCode != ''"> and t3.order_code = #{orderCode}</if>
|
||||
<if test="projectName != null and projectName != ''"> and t5.project_name like concat('%',#{projectName},'%')</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="logisticsCompany != null and logisticsCompany != ''">and t1.logistics_company =
|
||||
#{logisticsCompany}
|
||||
</if>
|
||||
<if test="deliveryStatus != null and deliveryStatus != ''">and t1.delivery_status = #{deliveryStatus}</if>
|
||||
<if test="logisticsCode != null and logisticsCode != ''">and t1.logistics_code = #{logisticsCode}</if>
|
||||
<if test="deliveryTimeType != null and deliveryTimeType != ''">and t1.delivery_time_type =
|
||||
#{deliveryTimeType}
|
||||
</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>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,14 +32,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectInventoryInfoList" parameterType="InventoryInfo" resultMap="InventoryInfoResult">
|
||||
<include refid="selectInventoryInfoVo"/>
|
||||
<where>
|
||||
<if test="productCode != null and productCode != ''"> and t1.product_code = #{productCode}</if>
|
||||
<if test="productSn != null and productSn != ''"> and t1.product_sn = #{productSn}</if>
|
||||
<if test="inventoryStatus != null and inventoryStatus != ''"> and t1.inventory_status = #{inventoryStatus}</if>
|
||||
<if test="innerCode != null and innerCode != ''"> and t1.inner_code = #{innerCode}</if>
|
||||
<if test="outerCode != null and outerCode != ''"> and t1.outer_code = #{outerCode}</if>
|
||||
<if test="warehouseId != null "> and t1.warehouse_id = #{warehouseId}</if>
|
||||
<if test="innerPrice != null "> and t1.inner_price = #{innerPrice}</if>
|
||||
<if test="outerPrice != null "> and t1.outer_price = #{outerPrice}</if>
|
||||
<if test="productCode != null and productCode != ''">and t1.product_code = #{productCode}</if>
|
||||
<if test="productCodeList != null and productCodeList != ''">and t1.product_code in
|
||||
<foreach item="item" index="index" collection="productCodeList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="productSn != null and productSn != ''">and t1.product_sn = #{productSn}</if>
|
||||
<if test="inventoryStatus != null and inventoryStatus != ''">and t1.inventory_status = #{inventoryStatus}
|
||||
</if>
|
||||
<if test="innerCode != null and innerCode != ''">and t1.inner_code = #{innerCode}</if>
|
||||
<if test="outerCode != null and outerCode != ''">and t1.outer_code = #{outerCode}</if>
|
||||
<if test="warehouseId != null ">and t1.warehouse_id = #{warehouseId}</if>
|
||||
<if test="innerPrice != null ">and t1.inner_price = #{innerPrice}</if>
|
||||
<if test="outerPrice != null ">and t1.outer_price = #{outerPrice}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -61,6 +67,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN oms_warehouse_info t2 ON t1.warehouse_id = t2.id
|
||||
order by t1.available_count
|
||||
</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">
|
||||
|
|
|
|||
|
|
@ -42,6 +42,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectInventoryOuterDetailVo"/>
|
||||
where id = #{id}
|
||||
</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 into oms_inventory_outer_detail
|
||||
|
|
|
|||
|
|
@ -59,13 +59,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
t1.update_time,
|
||||
t1.delivery_status,
|
||||
t2.model,
|
||||
|
||||
t3.id as order_id,
|
||||
t5.user_name as createByName,
|
||||
t4.project_code,
|
||||
t4.project_name
|
||||
from oms_inventory_outer t1
|
||||
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_info t4 on t4.id = t3.project_id
|
||||
left join sys_user t5 on t1.create_by = t5.user_id
|
||||
|
||||
|
||||
</sql>
|
||||
|
|
@ -141,6 +143,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectInventoryOuterRelationVo"/>
|
||||
where t1.outer_code=#{code}
|
||||
</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 into oms_inventory_outer
|
||||
|
|
|
|||
|
|
@ -19,23 +19,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectOmsInventoryInnerVo">
|
||||
select t1.id, t1.inner_code, t1.product_code, t1.quantity, t1.warehouse_id, t1.create_by, t1.update_by, t1.create_time, t1.update_time ,t1.vendor_code,
|
||||
t2.warehouse_name, t3.user_name as create_by_name,
|
||||
t4.vendor_name
|
||||
t4.vendor_name,t5.model
|
||||
from oms_inventory_inner t1
|
||||
left join oms_warehouse_info t2 on t1.warehouse_id = t2.id
|
||||
left join oms_vendor_info t4 on t1.vendor_code = t4.vendor_code
|
||||
left join sys_user t3 on t1.create_by = t3.user_id
|
||||
left join product_info t5 on t1.product_code = t5.product_code
|
||||
</sql>
|
||||
|
||||
<select id="selectOmsInventoryInnerList" parameterType="OmsInventoryInner" resultMap="OmsInventoryInnerResult">
|
||||
<include refid="selectOmsInventoryInnerVo"/>
|
||||
<where>
|
||||
<if test="vendorCode != null and vendorCode != ''"> and t1.vendorr_code = #{vendorCode}</if>
|
||||
<if test="vendorCode != null and vendorCode != ''"> and t1.vendor_code = #{vendorCode}</if>
|
||||
<if test="innerCode != null and innerCode != ''"> and t1.inner_code = #{innerCode}</if>
|
||||
<if test="productCode != null and productCode != ''"> and t1.product_code = #{productCode}</if>
|
||||
<if test="quantity != null "> and t1.quantity = #{quantity}</if>
|
||||
<if test="warehouseId != null "> and t1.warehouse_id = #{warehouseId}</if>
|
||||
<if test="createBy != null and createBy != ''"> and t1.create_by like concat('%', #{createBy}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and t1.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
<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>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -68,44 +68,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectProjectOrderInfoList" parameterType="ProjectOrderInfo" resultMap="ProjectOrderInfoResult">
|
||||
<include refid="selectProjectOrderInfoRelationVo"/>
|
||||
<where>
|
||||
<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="projectName != null and projectName!=''"> and t2.project_name like concat('%', #{projectName},'%')</if>
|
||||
<if test="customerName != null and customerName!=''"> and t2.customer_name like concat('%',#{customerName},'%')</if>
|
||||
<if test="agentName != null and agentName!=''"> and t4.agent_name like concat('%',#{agentName},'%')</if>
|
||||
<if test="province != null and province != ''"> and t1.province = #{province}</if>
|
||||
<if test="city != null and city != ''"> and t1.city = #{city}</if>
|
||||
<if test="businessPerson != null and businessPerson != ''"> and t1.business_person = #{businessPerson}</if>
|
||||
<if test="businessEmail != null and businessEmail != ''"> and t1.business_email = #{businessEmail}</if>
|
||||
<if test="businessPhone != null and businessPhone != ''"> and t1.business_phone = #{businessPhone}</if>
|
||||
<if test="orderCode != null and orderCode != ''"> and t1.order_code = #{orderCode}</if>
|
||||
<if test="currencyType != null and currencyType != ''"> and t1.currencyType = #{currencyType}</if>
|
||||
<if test="shipmentAmount != null "> and t1.shipment_amount = #{shipmentAmount}</if>
|
||||
<if test="actualPurchaseAmount != null "> and t1.actual_purchase_amount = #{actualPurchaseAmount}</if>
|
||||
<if test="orderEndTime != null "> and t1.order_end_time = #{orderEndTime}</if>
|
||||
<if test="deliveryTime != null "> and t1.delivery_time = #{deliveryTime}</if>
|
||||
<if test="companyDelivery != null and companyDelivery != ''"> and t1.company_delivery = #{companyDelivery}</if>
|
||||
<if test="notifier != null and notifier != ''"> and t1.notifier = #{notifier}</if>
|
||||
<if test="notifierEmail != null and notifierEmail != ''"> and t1.notifier_email = #{notifierEmail}</if>
|
||||
<if test="notifierPhone != null and notifierPhone != ''"> and t1.notifier_phone = #{notifierPhone}</if>
|
||||
<if test="notifierAddress != null and notifierAddress != ''"> and t1.notifier_address = #{notifierAddress}</if>
|
||||
<if test="duty != null and duty != ''"> and t1.duty = #{duty}</if>
|
||||
<if test="dutyName != null and dutyName != ''"> and t5.user_name like concat('%', #{dutyName}, '%')</if>
|
||||
<if test="dutyEmail != null and dutyEmail != ''"> and t1.duty_email = #{dutyEmail}</if>
|
||||
<if test="dutyPhone != null and dutyPhone != ''"> and t1.duty_phone = #{dutyPhone}</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="projectId != null ">and t1.project_id = #{projectId}</if>
|
||||
<if test="projectCode != null and projectCode!='' ">and t2.project_code like
|
||||
concat('%',#{projectCode},'%')
|
||||
</if>
|
||||
<if test="projectName != null and projectName!=''">and t2.project_name like concat('%',
|
||||
#{projectName},'%')
|
||||
</if>
|
||||
<if test="customerName != null and customerName!=''">and t2.customer_name like
|
||||
concat('%',#{customerName},'%')
|
||||
</if>
|
||||
<if test="agentName != null and agentName!=''">and t4.agent_name like concat('%',#{agentName},'%')</if>
|
||||
<if test="province != null and province != ''">and t1.province = #{province}</if>
|
||||
<if test="city != null and city != ''">and t1.city = #{city}</if>
|
||||
<if test="businessPerson != null and businessPerson != ''">and t1.business_person = #{businessPerson}</if>
|
||||
<if test="businessEmail != null and businessEmail != ''">and t1.business_email = #{businessEmail}</if>
|
||||
<if test="businessPhone != null and businessPhone != ''">and t1.business_phone = #{businessPhone}</if>
|
||||
<if test="orderCode != null and orderCode != ''">and t1.order_code = #{orderCode}</if>
|
||||
<if test="currencyType != null and currencyType != ''">and t1.currencyType = #{currencyType}</if>
|
||||
<if test="shipmentAmount != null ">and t1.shipment_amount = #{shipmentAmount}</if>
|
||||
<if test="actualPurchaseAmount != null ">and t1.actual_purchase_amount = #{actualPurchaseAmount}</if>
|
||||
<if test="orderEndTime != null ">and t1.order_end_time = #{orderEndTime}</if>
|
||||
<if test="deliveryTime != null ">and t1.delivery_time = #{deliveryTime}</if>
|
||||
<if test="companyDelivery != null and companyDelivery != ''">and t1.company_delivery = #{companyDelivery}
|
||||
</if>
|
||||
<if test="notifier != null and notifier != ''">and t1.notifier = #{notifier}</if>
|
||||
<if test="notifierEmail != null and notifierEmail != ''">and t1.notifier_email = #{notifierEmail}</if>
|
||||
<if test="notifierPhone != null and notifierPhone != ''">and t1.notifier_phone = #{notifierPhone}</if>
|
||||
<if test="notifierAddress != null and notifierAddress != ''">and t1.notifier_address = #{notifierAddress}
|
||||
</if>
|
||||
<if test="duty != null and duty != ''">and t1.duty = #{duty}</if>
|
||||
<if test="dutyName != null and dutyName != ''">and t5.user_name like concat('%', #{dutyName}, '%')</if>
|
||||
<if test="dutyEmail != null and dutyEmail != ''">and t1.duty_email = #{dutyEmail}</if>
|
||||
<if test="dutyPhone != null and dutyPhone != ''">and t1.duty_phone = #{dutyPhone}</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">
|
||||
<choose>
|
||||
<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 test="deliveryTimeStart != null">
|
||||
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">
|
||||
<choose>
|
||||
<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 test="deliveryTimeStart != null">
|
||||
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">
|
||||
<choose>
|
||||
<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 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 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>
|
||||
|
||||
</choose>
|
||||
|
|
@ -147,7 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="orderEndTimeStart != null or orderEndTimeEnd != null">
|
||||
<choose>
|
||||
<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 test="orderEndTimeStart != null">
|
||||
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>
|
||||
</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>
|
||||
</select>
|
||||
|
||||
|
|
@ -277,7 +303,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
</insert>
|
||||
<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>
|
||||
|
||||
<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="remark != null">remark = #{remark},</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="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
<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,
|
||||
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
|
||||
left join product_info t2 on t1.product_bom_code = t2.product_code
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
<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
|
||||
<if test="id != null">and id != #{id}</if>
|
||||
</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 into partner_info
|
||||
|
|
@ -54,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="address != null">address,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactPhone != null">contact_phone,</if>
|
||||
<if test="contactEmail != null">contact_email,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="createAt != null">create_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="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactPhone != null">#{contactPhone},</if>
|
||||
<if test="contactEmail != null">#{contactEmail},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="createAt != null">#{createAt},</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="city != null">city = #{city},</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="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@
|
|||
<where>
|
||||
and t1.status = 0
|
||||
<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="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>
|
||||
|
|
@ -94,6 +99,17 @@
|
|||
and id!=#{id}
|
||||
</if>
|
||||
</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">
|
||||
|
|
|
|||
|
|
@ -28,14 +28,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectOmsWarehouseInfoList" parameterType="OmsWarehouseInfo" resultMap="OmsWarehouseInfoResult">
|
||||
<include refid="selectOmsWarehouseInfoVo"/>
|
||||
<where>
|
||||
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
|
||||
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if>
|
||||
<if test="warehouseStatus != null and warehouseStatus != ''"> and warehouse_status = #{warehouseStatus}</if>
|
||||
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||
<if test="managerName != null and managerName != ''"> and manager_name like concat('%', #{managerName}, '%')</if>
|
||||
<if test="managerPhone != null and managerPhone != ''"> and manager_phone = #{managerPhone}</if>
|
||||
<if test="managerEmail != null and managerEmail != ''"> and manager_email = #{managerEmail}</if>
|
||||
warehouse_status = '0'
|
||||
<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="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>
|
||||
|
||||
|
|
@ -59,6 +69,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</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 into oms_warehouse_info
|
||||
|
|
|
|||
|
|
@ -211,4 +211,6 @@ public interface ISysUserService
|
|||
* @return 结果
|
||||
*/
|
||||
public int changeStatus(SysUser user);
|
||||
|
||||
List<SysUser> listByRoleId(String l);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
|
|
@ -565,4 +566,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
{
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> listByRoleId(String roleId) {
|
||||
return userMapper.listUserByRoleId(roleId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue