feat: 新增带数据的发货导入模板下载功能,优化审批状态显示与产品筛选逻辑

1. 新增/importTemplateData接口,支持下载带查询数据的发货导入模板
2. 修复审批标签页和状态显示文本不一致问题,将"已通过"改为"已处理"
3. 优化产品二级类型筛选逻辑,配件类型不显示终端配置项
4. 移除本地日志路径配置,修正MyBatis权限查询条件
5. 更新前端模板下载调用逻辑,传入查询参数
dev_1.0.3
kangwenjing 2026-09-02 09:36:33 +08:00
parent a249239e77
commit 73cacea552
7 changed files with 75 additions and 15 deletions

View File

@ -79,6 +79,14 @@ export function exportDownloadTemplate() {
method: 'get'
})
}
// 下载带列表数据的发货导入模板
export function exportDownloadTemplateData(data) {
return request({
url: '/inventory/outer/importTemplateData',
method: 'post',
data: data
})
}
export function importSnData(formData) {
return request({
url: '/inventory/outer/vue/importData',

View File

@ -546,7 +546,7 @@ export default {
tabs: [
{ label: '全部', name: 'all' },
{ label: '待处理', name: 'pending' },
{ label: '已通过', name: 'processed' },
{ label: '已处理', name: 'processed' },
{ label: '已归档', name: 'approved' },
{ label: '已驳回', name: 'returned' }
],
@ -758,9 +758,9 @@ export default {
},
getApproveStatusLabel(row) {
if (row.approveStatus === '1') {
return this.isCurrentApproveUser(row) ? '待处理' : '已通过'
return this.isCurrentApproveUser(row) ? '待处理' : '已处理'
}
const map = { 2: '已通过', 3: '已驳回' }
const map = { 2: '已处理', 3: '已驳回' }
return map[row.approveStatus] || ''
},
getApproveStatusTagType(row) {

View File

@ -106,7 +106,7 @@
<script>
import { addDelivery, listProductSn } from '@/api/inventory/delivery';
import {importSnData,exportDownloadTemplate,assignDeliverySnData} from '@/api/inventory/outer'
import {importSnData,exportDownloadTemplateData,assignDeliverySnData} from '@/api/inventory/outer'
import PurchaseOrderSelectDialog from '../../../purchaseorder/components/PurchaseOrderSelectDialog.vue';
import {handleTree} from "@/utils/ruoyi";
import { productMatchBindList } from '@/api/project/order';
@ -270,7 +270,13 @@ export default {
this.selectedSnList = selection;
},
handleDownloadTemplate() {
exportDownloadTemplate().then(response => {
exportDownloadTemplateData({
productCode: this.queryParams.productCode,
warehouseId: this.queryParams.warehouseId,
orderCode: this.queryParams.orderCode,
purchaseNo: this.queryParams.purchaseNo,
inventoryStatus: this.queryParams.inventoryStatus
}).then(response => {
const fileName = response.msg;
window.location.href = process.env.VUE_APP_BASE_API + "/common/download?fileName=" + encodeURIComponent(fileName) + "&delete=" + true;
}).catch(() => {

View File

@ -566,8 +566,9 @@ export default {
});
},
handleLevel2TypeChange(level2Type) {
//
if (this.form.type == 2) {
// "-"(dictValue=6)//CPU
const isAccessory = level2Type == 6;
if (this.form.type == 2 && !isAccessory) {
this.level2TypeRelation = true;
//
this.rules.terminalType = [{ required: true, message: "终端类型不能为空", trigger: "change" }];

View File

@ -2,6 +2,7 @@
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/Users/jiliu/WorkSpace/java/RuoYi/logs" />
<!-- <property name="log.path" value="/Users/kangwenjing/Downloads/project/logs" />-->
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />

View File

@ -3,11 +3,14 @@ package com.ruoyi.sip.controller;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IInventoryInfoService;
import com.ruoyi.sip.service.IOmsInventoryInnerService;
import com.ruoyi.sip.vo.OuterDeliveryVo;
import com.ruoyi.sip.vo.OuterViewVo;
@ -18,6 +21,7 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.InventoryInfo;
import com.ruoyi.sip.domain.InventoryOuter;
import com.ruoyi.sip.service.IInventoryOuterService;
import com.ruoyi.common.core.controller.BaseController;
@ -41,6 +45,8 @@ public class InventoryOuterController extends BaseController
@Autowired
private IInventoryOuterService inventoryOuterService;
@Autowired
private IInventoryInfoService inventoryInfoService;
@Autowired
private IOmsInventoryInnerService innerService;
@Autowired
private IInventoryAuthService inventoryAuthService;
@ -161,6 +167,44 @@ public class InventoryOuterController extends BaseController
return util.importTemplateExcel("发货数据");
}
/**
*
*/
@PostMapping("/importTemplateData")
@ResponseBody
public AjaxResult importTemplateData(@RequestBody(required = false) InventoryInfo query)
{
ExcelUtil<InventoryInfoExcelDto> util = new ExcelUtil<InventoryInfoExcelDto>(InventoryInfoExcelDto.class);
if (query == null || StringUtils.isEmpty(query.getProductCode()))
{
return util.importTemplateExcel("发货数据");
}
// 与列表查询保持一致:权限过滤 + 库存状态为入库(0)
if (!inventoryAuthService.authAll())
{
List<String> productCodeList = inventoryAuthService.authProductCode();
if (CollUtil.isEmpty(productCodeList))
{
return util.exportExcel(Collections.emptyList(), "发货数据");
}
query.setProductCodeList(productCodeList);
}
if (StringUtils.isEmpty(query.getInventoryStatus()))
{
query.setInventoryStatus(InventoryInfo.InventoryStatusEnum.INNER.getCode());
}
List<InventoryInfo> list = inventoryInfoService.selectInventoryInfoList(query);
List<InventoryInfoExcelDto> dataList = list.stream().map(item -> {
InventoryInfoExcelDto dto = new InventoryInfoExcelDto();
dto.setProductCode(item.getProductCode());
dto.setModel(item.getModel());
dto.setProductDesc(item.getProductDesc());
dto.setWarehouseName(item.getWarehouseName());
return dto;
}).collect(Collectors.toList());
return util.exportExcel(dataList, "发货数据");
}
@PostMapping("/importData")
@ResponseBody
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode

View File

@ -1287,7 +1287,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('finance_payment')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key
@ -1319,7 +1319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('finance_refund')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key
@ -1351,7 +1351,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('fianance_ticket')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key
@ -1383,7 +1383,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('finance_ticket_refound')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key
@ -1415,7 +1415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('finance_receipt_approve')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key
@ -1447,7 +1447,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('finance_receipt_refound')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key
@ -1479,7 +1479,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('finance_invoice_approve')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key
@ -1511,7 +1511,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (
select business_key, count(1) as bu_todo_count from bu_todo as tt
where tt.process_key in ('finance_invoice_refound')
<if test="approveUser != null and approveUser != &quot;1&quot; and !financeView">
<if test="approveUser != null and approveUser != &quot;1&quot;">
and tt.approve_user = #{approveUser}
</if>
group by business_key