feat(inventory): 新增入库单附件上传功能
- 在入库单添加页面增加附件上传功能 - 实现文件上传、删除和显示逻辑 - 添加文件上传相关接口和数据库表 - 优化订单信息页面布局和流转过程展示dev_1.0.0
parent
0450796bfd
commit
7601173ea8
|
|
@ -4,6 +4,11 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.sip.domain.OmsFileLog;
|
||||
import com.ruoyi.sip.service.IOmsFileLogService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -35,6 +40,8 @@ public class CommonController
|
|||
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
@Autowired
|
||||
private IOmsFileLogService fileLogService;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
|
|
@ -84,7 +91,17 @@ public class CommonController
|
|||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
OmsFileLog omsFileLog =OmsFileLog.builder()
|
||||
.url(url)
|
||||
.fileName(fileName)
|
||||
.newFilename(FileUtils.getName(fileName))
|
||||
.originalFilename(file.getOriginalFilename())
|
||||
.createBy(ShiroUtils.getUserId().toString())
|
||||
.createTime(DateUtil.date())
|
||||
.build();
|
||||
fileLogService.insert(omsFileLog);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("id", omsFileLog.getId());
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<body class="white-bg">
|
||||
<body class="white-bg" style="padding: 20px 100px;">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form id="form-order-edit" th:object="${projectOrderInfo}">
|
||||
<div class="section-title">
|
||||
|
|
@ -543,8 +543,8 @@ function initWarehouseTable(data) {
|
|||
field: 'warehouseName',
|
||||
title: '仓库',
|
||||
formatter: function (value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='hidden' name='detailList[%s].warehouseId' value='%s'>" +
|
||||
"<input class='form-control' type='hidden' name='detailList[%s].quantity' value='%s'>", index, row.warehouseId, index, row.confirmQuantity);
|
||||
var html = $.common.sprintf("<input class='form-control' type='hidden' name='detailList[%s].warehouseId' value='%s'>"
|
||||
, index, row.warehouseId);
|
||||
return value + html;
|
||||
}
|
||||
},
|
||||
|
|
@ -560,37 +560,52 @@ function initWarehouseTable(data) {
|
|||
{
|
||||
field: 'confirmQuantity',
|
||||
title: '本次提交出库',
|
||||
editable: {
|
||||
type: 'number',
|
||||
min: 0,
|
||||
title: '本次提交出库',
|
||||
emptytext: "【本次提交出库】为空",
|
||||
validate: function (value) {
|
||||
if (!value) {
|
||||
return '数量不能空';
|
||||
}
|
||||
if (value > Number.MAX_VALUE) {
|
||||
return '数量不能超过' + Number.MAX_VALUE;
|
||||
}
|
||||
if (value < 0) {
|
||||
return '数量不能为负数';
|
||||
}
|
||||
},
|
||||
toggleDisabled: function (isEnable) {
|
||||
if (isEnable) {
|
||||
console.log("enable")
|
||||
this.enable();// 可编辑
|
||||
} else {
|
||||
console.log("disable")
|
||||
this.disabled();// 不可编辑
|
||||
}
|
||||
}
|
||||
formatter: function (value, row, index) {
|
||||
return $.common.sprintf("<input class='form-control' type='number' name='detailList[%s].confirmQuantity' onchange=onEdit(this.value) value='%s' min='0' max='%s'>", index, value, row.availableCount);
|
||||
}
|
||||
|
||||
// editable: {
|
||||
// type: 'number',
|
||||
// min: 0,
|
||||
// title: '本次提交出库',
|
||||
// emptytext: "【本次提交出库】为空",
|
||||
// validate: function (value) {
|
||||
// if (!value) {
|
||||
// return '数量不能空';
|
||||
// }
|
||||
// if (value > Number.MAX_VALUE) {
|
||||
// return '数量不能超过' + Number.MAX_VALUE;
|
||||
// }
|
||||
// if (value < 0) {
|
||||
// return '数量不能为负数';
|
||||
// }
|
||||
// },
|
||||
// toggleDisabled: function (isEnable) {
|
||||
// if (isEnable) {
|
||||
// console.log("enable")
|
||||
// this.enable();// 可编辑
|
||||
// } else {
|
||||
// console.log("disable")
|
||||
// this.disabled();// 不可编辑
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
}
|
||||
|
||||
function onEdit(value) {
|
||||
let totalConfirmQuantity = 0;
|
||||
$("input[name$='confirmQuantity']").each(function () {
|
||||
let val = $(this).val();
|
||||
if (val && !isNaN(val)) {
|
||||
totalConfirmQuantity += Number(val);
|
||||
}
|
||||
});
|
||||
$('#out-current-quantity').text(totalConfirmQuantity)
|
||||
$('#out-current-quantity-commit').val(totalConfirmQuantity)
|
||||
}
|
||||
|
||||
function onEditableSave(field, row, rowIndex, oldValue, $el) {
|
||||
if (!row['defaultWarehouse'] && row[field] > row['availableCount']) {
|
||||
|
|
@ -667,6 +682,31 @@ function initWarehouseTable(data) {
|
|||
content: $('#generateOuter'), // 捕获的元素
|
||||
btn: ['确定', '关闭'],
|
||||
yes: function (index, layero, that) {
|
||||
let totalConfirmQuantity = 0;
|
||||
let errFlag = false;
|
||||
$("input[name$='confirmQuantity']").each(function () {
|
||||
let val = $(this).val();
|
||||
if (val && !isNaN(val)) {
|
||||
if (Number(val) <= 0) {
|
||||
errFlag = true;
|
||||
}
|
||||
totalConfirmQuantity += Number(val);
|
||||
}
|
||||
});
|
||||
if (errFlag) {
|
||||
$.modal.msgError("本次提交出库数量应大于0")
|
||||
return;
|
||||
}
|
||||
if (totalConfirmQuantity <= 0) {
|
||||
$.modal.msgError("本次提交出库数量应大于0")
|
||||
return;
|
||||
}
|
||||
let generateNumber = $('#out-generatedQuantity').text();
|
||||
let allTotal = totalConfirmQuantity + Number(generateNumber)
|
||||
if (allTotal > Number($('#out-quantity').text())) {
|
||||
$.modal.msgError("本次提交出库数量+已提交出库数量不能大于应出库数量")
|
||||
return;
|
||||
}
|
||||
$('#deliveryTime').attr('disabled', false);
|
||||
$.operate.post(outerPrefix + "/add", $('#generateOuterForm').serializeArray(), res => {
|
||||
refreshTable();
|
||||
|
|
@ -680,7 +720,7 @@ function initWarehouseTable(data) {
|
|||
// layer.msg('关闭后的回调', {icon:6});
|
||||
}
|
||||
});
|
||||
layer.full(index);
|
||||
// layer.full(index);
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -884,7 +924,7 @@ function initWarehouseTable(data) {
|
|||
// layer.msg('关闭后的回调', {icon:6});
|
||||
}
|
||||
});
|
||||
layer.full(index);
|
||||
// layer.full(index);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<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>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
padding-right: 0px;
|
||||
}
|
||||
</style>
|
||||
<body class="white-bg">
|
||||
<body class="white-bg" style="padding: 0px 150px">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-inner-add">
|
||||
<div class="col-xs-12">
|
||||
|
|
@ -42,16 +42,44 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-5 control-label">备注:</label>
|
||||
<div class="col-sm-7">
|
||||
<input name="remark" class="form-control" type="text" placeholder="备注信息"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-5 control-label">附件信息:</label>
|
||||
<div class="col-sm-7">
|
||||
<div class="input-group">
|
||||
<input id="fileName" class="form-control" type="text" readonly placeholder="未选择文件"/>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" onclick="uploadFile()">
|
||||
<i class="fa fa-upload"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" id="deleteFileBtn" onclick="deleteFile()" style="display: none;">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<input id="fileId" name="fileId" type="hidden"/>
|
||||
<input id="uploadInput1" type="file" style="display: none" onchange="handleFileUpload(event)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<h2 >产品信息</h2>
|
||||
</div>
|
||||
<div class="col-xs-12" style="display: flex;justify-content: space-between;">
|
||||
<div class="btn-group-sm">
|
||||
<a class="btn btn-info" onclick="downloadTem()">
|
||||
<a class="btn btn-info" shiro:hasPermission="inventory:inner:import" onclick="downloadTem()">
|
||||
下载模板
|
||||
</a>
|
||||
|
||||
<a class="btn btn-warning" onclick="importList()">
|
||||
<a class="btn btn-warning" shiro:hasPermission="inventory:inner:import" onclick="importList()">
|
||||
导入
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -165,6 +193,7 @@
|
|||
</div>
|
||||
<th:block th:include="include :: footer"/>
|
||||
<script th:inline="javascript">
|
||||
var importFlag = [[${@permission.hasPermi('inventory:inner:import')}]];
|
||||
var prefix = ctx + "inventory/inner"
|
||||
// 获取 ctx 的通用函数
|
||||
function getCtx() {
|
||||
|
|
@ -474,6 +503,79 @@
|
|||
$('#uploadInput').click()
|
||||
}
|
||||
|
||||
|
||||
// 文件上传
|
||||
function uploadFile() {
|
||||
$('#uploadInput1').click();
|
||||
}
|
||||
|
||||
// 处理文件上传
|
||||
function handleFileUpload(event) {
|
||||
const file = event.target.files[0];
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
|
||||
$.modal.loading("正在上传文件,请稍候...");
|
||||
|
||||
$.ajax({
|
||||
url: ctx + "common/upload",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function(result) {
|
||||
$.modal.closeLoading();
|
||||
if (result.code === 0) {
|
||||
// 显示文件名
|
||||
$('#fileName').val(result.originalFilename || result.data.originalFilename);
|
||||
// 存储文件ID
|
||||
$('#fileId').val(result.fileId || result.data.fileId);
|
||||
// 显示删除按钮
|
||||
$('#deleteFileBtn').show();
|
||||
$.modal.msgSuccess("文件上传成功");
|
||||
} else {
|
||||
$.modal.msgError(result.msg || "上传失败");
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$.modal.closeLoading();
|
||||
$.modal.msgError("文件上传失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 删除文件
|
||||
function deleteFile() {
|
||||
var fileId = $('#fileId').val();
|
||||
if (!fileId) {
|
||||
resetFileInput();
|
||||
return;
|
||||
}
|
||||
|
||||
top.layer.confirm("确定要删除该附件吗?", {
|
||||
icon: 3,
|
||||
title: "警告"
|
||||
}, function(index) {
|
||||
// 这里可以调用后端删除接口(如果需要)
|
||||
// 如果只是前端删除,则直接重置
|
||||
resetFileInput();
|
||||
top.layer.close(index);
|
||||
$.modal.msgSuccess("附件已删除");
|
||||
});
|
||||
}
|
||||
|
||||
// 重置文件输入
|
||||
function resetFileInput() {
|
||||
$('#fileName').val('');
|
||||
$('#fileId').val('');
|
||||
$('#uploadInput1').val('');
|
||||
$('#deleteFileBtn').hide();
|
||||
}
|
||||
|
||||
document.getElementById('uploadInput').addEventListener('change', function (event) {
|
||||
const file = event.target.files[0];
|
||||
let data = new FormData()
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12" style="padding: 13px 200px;">
|
||||
<div class="section-title col-xs-12">
|
||||
<span>产品清单</span>
|
||||
</div>
|
||||
|
|
@ -98,9 +99,10 @@
|
|||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="delivery-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="generateDelivery" style="display: none">
|
||||
<div id="generateDelivery" style="display: none;padding: 0px 200px;">
|
||||
<div class="col-xs-12 section-title" id="delivery-title" style="display: flex;justify-content: space-between">
|
||||
<div></div>
|
||||
<div class="delivery-title">发货单</div>
|
||||
|
|
@ -109,7 +111,7 @@
|
|||
|
||||
</div>
|
||||
<form class="form-horizontal m" id="generateDeliveryForm">
|
||||
<div class="col-xs-12">
|
||||
<div class="col-xs-12" >
|
||||
<input type="hidden" id="deliveryQuantity">
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -160,7 +162,7 @@
|
|||
<i class="fa fa-upload"></i> 导入
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<div class="col-sm-12 select-table table-striped" style="padding: 1px 70px;">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
<input id="uploadInput" type="file" accept=".xls,.xlsx" style="display: none">
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@
|
|||
<div class="layui-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this" lay-id="11">配置信息</li>
|
||||
<li lay-id="22">审批信息</li>
|
||||
<li lay-id="22">流转过程</li>
|
||||
<li lay-id="33">备货信息</li>
|
||||
<li lay-id="44">物流信息</li>
|
||||
<li lay-id="55">合同信息</li>
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@
|
|||
</li>
|
||||
<li th:class="${projectOrderInfo.processTemplate!='1'?'':'active'}">
|
||||
<a data-toggle="tab" href="#tab-2" aria-expanded="flase">
|
||||
流转意见</a>
|
||||
流转过程</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
|
|
@ -392,6 +392,7 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>附件类型</th>
|
||||
<th>附件名称</th>
|
||||
<th>上传人</th>
|
||||
<th>上传时间</th>
|
||||
|
|
@ -401,6 +402,7 @@
|
|||
<tbody>
|
||||
<tr th:each="file,fileStat : ${entry.value}">
|
||||
<td style="display: none">[[${file.id}]]</td>
|
||||
<td>[[${fileStat.index+1==1?'合同':fileStat.index+1==2?'商务审批':'补充附件'}]]</td>
|
||||
<td>[[${file.fileName}]]</td>
|
||||
<td>[[${file.uploadUserName}]]</td>
|
||||
<td>[[${#dates.format(file.uploadTime,'yyyy-MM-dd')}]]</td>
|
||||
|
|
@ -603,9 +605,9 @@
|
|||
if ([[${todo.taskName == '商务' && projectOrderInfo.processTemplate == '0'}]]) {
|
||||
//判断是否线下合同
|
||||
let fileSortArr = ['0']
|
||||
if ([[${projectOrderInfo.processType == '1'}]]) {
|
||||
fileSortArr = ['0', '1']
|
||||
}
|
||||
// if ([[${projectOrderInfo.processType == '1'}]]) {
|
||||
// fileSortArr = ['0', '1']
|
||||
// }
|
||||
|
||||
let fileList = [[${projectOrderInfo.contractTableData.get(projectOrderInfo.versionCode)}]]
|
||||
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@
|
|||
<li class="layui-this" lay-id="11" th:if="${showFileFlag || orderBakFile.size()>0}">合同信息</li>
|
||||
<li lay-id="22" th:class="${(showFileFlag || orderBakFile.size()>0)?'':'layui-this'}">备货信息</li>
|
||||
<li lay-id="33">物流信息</li>
|
||||
<li lay-id="44">审批信息</li>
|
||||
<li lay-id="44">流转过程</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
|
||||
|
|
@ -416,6 +416,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>类型</th>
|
||||
<th>附件名称</th>
|
||||
<th>上传人</th>
|
||||
<th>上传时间</th>
|
||||
|
|
@ -425,6 +426,7 @@
|
|||
<tbody>
|
||||
<tr th:each="file,fileStat : ${entry.value}">
|
||||
<td>[[${fileStat.index+1}]]</td>
|
||||
<td>[[${fileStat.index+1==1?'合同':fileStat.index+1==2?'折扣审批':'补充附件'}]]</td>
|
||||
<td style="display: none">[[${file.id}]]</td>
|
||||
<td>[[${file.fileName}]]</td>
|
||||
<td>[[${file.uploadUserName}]]</td>
|
||||
|
|
@ -765,6 +767,22 @@
|
|||
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
|
||||
return
|
||||
}
|
||||
let flag=false;
|
||||
$('#file-version-content .current-version').find('tbody tr').each(function (trIndex, trElement) {
|
||||
|
||||
if (trIndex==1) {
|
||||
|
||||
$(trElement).find('td').each(function (index, element) {
|
||||
if (index === 2 && $(element).text()!='-1') {
|
||||
flag=true;
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
if (!flag){
|
||||
$.modal.alertWarning("请补充商务审批文件");
|
||||
return;
|
||||
}
|
||||
if ($.validate.form()) {
|
||||
parent.$('.layui-layer-btn').hide()
|
||||
parent.$('.saveDraft').hide()
|
||||
|
|
@ -1130,8 +1148,10 @@
|
|||
}
|
||||
$(trElement).find('td').each(function (index, element) {
|
||||
if (index === 1) {
|
||||
$(element).text(data.id)
|
||||
$(element).text(sortNum==1?'合同':sortNum==2?'折扣审批':'补充附件')
|
||||
} else if (index === 2) {
|
||||
$(element).text(data.id)
|
||||
} else if (index === 3) {
|
||||
$(element).text(data.fileName)
|
||||
} else if (index === 3) {
|
||||
$(element).text(data.uploadUserName)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
package com.ruoyi.sip.controller;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.sip.domain.OmsFileLog;
|
||||
import com.ruoyi.sip.service.IOmsFileLogService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (OmsFileLog)表控制层
|
||||
* @Date 2025-08-27 17:40:30
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("omsFileLog")
|
||||
public class OmsFileLogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IOmsFileLogService omsFileLogService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OmsFileLog omsFileLog) {
|
||||
startPage();
|
||||
List<OmsFileLog> list = omsFileLogService.queryAll(omsFileLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(omsFileLogService.queryById(id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult add(@RequestBody OmsFileLog omsFileLog) {
|
||||
return toAjax(omsFileLogService.insert(omsFileLog));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PutMapping("/update")
|
||||
public AjaxResult edit(@RequestBody OmsFileLog omsFileLog) {
|
||||
return toAjax(omsFileLogService.update(omsFileLog));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return toAjax(omsFileLogService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键批量删除
|
||||
*/
|
||||
|
||||
@DeleteMapping("/remove/batch/{ids}")
|
||||
public AjaxResult batchRemove(@PathVariable("ids") Integer[] ids) {
|
||||
return AjaxResult.success(omsFileLogService.batchRemove(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -189,10 +189,10 @@ public class ProjectOrderInfoController extends BaseController
|
|||
mmap.put("projectOrderInfo", projectOrderInfo);
|
||||
mmap.put("user", ShiroUtils.getSysUser());
|
||||
mmap.put("canUpdate", ProjectOrderInfo.OrderStatus.WAIT_COMMIT.getCode().equals(projectOrderInfo.getOrderStatus()) ||ProjectOrderInfo.OrderStatus.APPROVE_REJECT.getCode().equals(projectOrderInfo.getOrderStatus()));
|
||||
boolean showFileFlag=!ProjectOrderInfo.OrderStatus.WAIT_COMMIT.getCode().equals(projectOrderInfo.getOrderStatus())
|
||||
&& !ProjectOrderInfo.OrderStatus.APPROVE_REJECT.getCode().equals(projectOrderInfo.getOrderStatus())
|
||||
&& !"1".equals(projectOrderInfo.getProcessTemplate());
|
||||
mmap.put("showFileFlag", showFileFlag);
|
||||
// boolean showFileFlag=!ProjectOrderInfo.OrderStatus.WAIT_COMMIT.getCode().equals(projectOrderInfo.getOrderStatus())
|
||||
// && !ProjectOrderInfo.OrderStatus.APPROVE_REJECT.getCode().equals(projectOrderInfo.getOrderStatus())
|
||||
// && !"1".equals(projectOrderInfo.getProcessTemplate());
|
||||
mmap.put("showFileFlag", true);
|
||||
|
||||
ProjectOrderFileLog fileLog = new ProjectOrderFileLog();
|
||||
fileLog.setOrderId(projectOrderInfo.getId());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* (OmsFileLog)实体类
|
||||
*
|
||||
* @author ch
|
||||
* @since 2025-08-27 18:01:33
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class OmsFileLog {
|
||||
|
||||
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String url;
|
||||
|
||||
|
||||
private String fileName;
|
||||
|
||||
|
||||
private String newFilename;
|
||||
|
||||
|
||||
private String originalFilename;
|
||||
|
||||
|
||||
private String createBy;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -49,6 +49,9 @@ public class OmsInventoryInner extends BaseEntity {
|
|||
private String vendorName;
|
||||
private String vendorCode;
|
||||
private String model;
|
||||
private Long fileId;
|
||||
private String remark;
|
||||
private String originalFilename;
|
||||
|
||||
/**
|
||||
* 仓库
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.ruoyi.sip.mapper;
|
||||
|
||||
import com.ruoyi.sip.domain.OmsFileLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (OmsFileLog)表数据库访问层
|
||||
* @Date 2025-08-27 17:40:30
|
||||
*/
|
||||
public interface OmsFileLogMapper {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*
|
||||
* @param omsFileLog 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<OmsFileLog> queryAll(OmsFileLog omsFileLog);
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
OmsFileLog queryById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(OmsFileLog omsFileLog);
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(OmsFileLog omsFileLog);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.ruoyi.sip.service;
|
||||
|
||||
import com.ruoyi.sip.domain.OmsFileLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (OmsFileLog)表服务接口
|
||||
* @Date 2025-08-27 17:40:30
|
||||
*/
|
||||
public interface IOmsFileLogService {
|
||||
|
||||
/**
|
||||
* 通过实体作为筛选条件查询
|
||||
*/
|
||||
List<OmsFileLog> queryAll(OmsFileLog omsFileLog);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查详情
|
||||
*/
|
||||
OmsFileLog queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*/
|
||||
int insert(OmsFileLog omsFileLog);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
int update(OmsFileLog omsFileLog);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
int batchRemove(Integer[] ids);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import com.ruoyi.sip.domain.OmsFileLog;
|
||||
import com.ruoyi.sip.mapper.OmsFileLogMapper;
|
||||
import com.ruoyi.sip.service.IOmsFileLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ch
|
||||
* @Desc (OmsFileLog)表服务实现类
|
||||
* @Date 2025-08-27 17:40:30
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class OmsFileLogServiceImpl implements IOmsFileLogService {
|
||||
|
||||
@Resource
|
||||
private OmsFileLogMapper omsFileLogMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*
|
||||
* @param omsFileLog 实例对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<OmsFileLog> queryAll(OmsFileLog omsFileLog) {
|
||||
List<OmsFileLog> dataList = omsFileLogMapper.queryAll(omsFileLog);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OmsFileLog queryById(Integer id) {
|
||||
return omsFileLogMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(OmsFileLog omsFileLog) {
|
||||
return omsFileLogMapper.insert(omsFileLog);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int update(OmsFileLog omsFileLog) {
|
||||
return omsFileLogMapper.update(omsFileLog);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteById(Integer id) {
|
||||
return omsFileLogMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id批量删除
|
||||
*/
|
||||
@Override
|
||||
public int batchRemove(Integer[] ids) {
|
||||
return omsFileLogMapper.batchRemove(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
private static final List<String> LS_LIST = Arrays.asList("3130A6LD");
|
||||
private static final List<String> ONE_STOR_LIST = Arrays.asList("3130A4NA", "3130A4N9", "3130A4N5");
|
||||
private static final List<String> N_VIDIA_LIST = Arrays.asList("0504A14F", "0504A14G", "0504A1JX");
|
||||
private static final List<String> FILE_INFO_LIST = Arrays.asList("(请上传合同信息).pdf/.jpg/.png", "(请上传商务折扣审批邮件信息).pdf/.jpg/.png", "(请上传现金折扣审批邮件信息).pdf/.jpg/.png", "(补充附件).zip/.rar/.jpg/.png");
|
||||
private static final List<String> FILE_INFO_LIST = Arrays.asList("(请上传合同信息).pdf/.jpg/.png", "(请上传商务折扣审批邮件信息).pdf/.jpg/.png", "(补充附件).zip/.rar/.jpg/.png");
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
} else {
|
||||
//将list转为map 根据序号补齐差的数据 给初始化数据
|
||||
Map<String, ProjectOrderFileLog> orderFileLogMap = fileLogs.stream().collect(Collectors.toMap(ProjectOrderFileLog::getFileSort, v -> v, (v1, v2) -> v1));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
ProjectOrderFileLog fileLog = orderFileLogMap.get(String.valueOf(i));
|
||||
if (fileLog == null) {
|
||||
//初始化map
|
||||
|
|
@ -191,7 +191,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
@Override
|
||||
public List<ProjectOrderFileLog> getProjectOrderFileLogs() {
|
||||
List<ProjectOrderFileLog> result = new ArrayList<>();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
result.add(initFileLog(i));
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -17,14 +17,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectOmsInventoryInnerVo">
|
||||
select t1.id, t1.inner_code, t1.product_code, t1.quantity, t1.warehouse_id, t1.create_by, t1.update_by, t1.create_time, t1.update_time ,t1.vendor_code,
|
||||
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,t1.file_id,t1.remark,
|
||||
t2.warehouse_name, t3.user_name as create_by_name,
|
||||
t4.vendor_name,t5.model
|
||||
,t6.original_filename
|
||||
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
|
||||
left join oms_file_log t6 on t1.file_id=t6.id
|
||||
</sql>
|
||||
<sql id="selectBaseInnerVo">
|
||||
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
|
||||
|
|
@ -90,6 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="quantity != null">quantity,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="vendorCode != null">vendor_code,</if>
|
||||
<if test="fileId != null">file_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
|
|
@ -101,6 +105,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="vendorCode != null">#{vendorCode},</if>
|
||||
<if test="fileId != null">#{fileId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
|
|
@ -114,6 +120,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="innerCode != null and innerCode != ''">inner_code = #{innerCode},</if>
|
||||
<if test="productCode != null">product_code = #{productCode},</if>
|
||||
<if test="vendorCode != null">vendor_code=#{vendorCode},</if>
|
||||
<if test="fileId != null">file_id=#{fileId},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.sip.mapper.OmsFileLogMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.sip.domain.OmsFileLog" id="OmsFileLogMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="url" column="url"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="newFilename" column="new_filename"/>
|
||||
<result property="originalFilename" column="original_filename"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基本字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, url, file_name, new_filename, original_filename, create_by, create_time
|
||||
</sql>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<select id="queryAll" resultMap="OmsFileLogMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from oms_file_log
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="url != null and url != ''">
|
||||
and url = #{url}
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
and file_name = #{fileName}
|
||||
</if>
|
||||
<if test="newFilename != null and newFilename != ''">
|
||||
and new_filename = #{newFilename}
|
||||
</if>
|
||||
<if test="originalFilename != null and originalFilename != ''">
|
||||
and original_filename = #{originalFilename}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--根据ID查详情-->
|
||||
<select id="queryById" parameterType="Integer" resultMap="OmsFileLogMap">
|
||||
SELECT
|
||||
id, url, file_name, new_filename, original_filename, create_by, create_time
|
||||
FROM oms_file_log
|
||||
WHERE id = #{id} LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO oms_file_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="url != null and url != ''">
|
||||
url,
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
file_name,
|
||||
</if>
|
||||
<if test="newFilename != null and newFilename != ''">
|
||||
new_filename,
|
||||
</if>
|
||||
<if test="originalFilename != null and originalFilename != ''">
|
||||
original_filename,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="url != null and url != ''">
|
||||
#{url},
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
#{fileName},
|
||||
</if>
|
||||
<if test="newFilename != null and newFilename != ''">
|
||||
#{newFilename},
|
||||
</if>
|
||||
<if test="originalFilename != null and originalFilename != ''">
|
||||
#{originalFilename},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
UPDATE oms_file_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="url != null and url != ''">
|
||||
url = #{url},
|
||||
</if>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
file_name = #{fileName},
|
||||
</if>
|
||||
<if test="newFilename != null and newFilename != ''">
|
||||
new_filename = #{newFilename},
|
||||
</if>
|
||||
<if test="originalFilename != null and originalFilename != ''">
|
||||
original_filename = #{originalFilename},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
DELETE FROM oms_file_log WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--通过id批量删除-->
|
||||
<delete id="batchRemove">
|
||||
delete from oms_file_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue