feat: 新增带数据的发货导入模板下载功能,优化审批状态显示与产品筛选逻辑
1. 新增/importTemplateData接口,支持下载带查询数据的发货导入模板 2. 修复审批标签页和状态显示文本不一致问题,将"已通过"改为"已处理" 3. 优化产品二级类型筛选逻辑,配件类型不显示终端配置项 4. 移除本地日志路径配置,修正MyBatis权限查询条件 5. 更新前端模板下载调用逻辑,传入查询参数dev_1.0.3
parent
a249239e77
commit
73cacea552
|
|
@ -79,6 +79,14 @@ export function exportDownloadTemplate() {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 下载带列表数据的发货导入模板
|
||||||
|
export function exportDownloadTemplateData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/inventory/outer/importTemplateData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
export function importSnData(formData) {
|
export function importSnData(formData) {
|
||||||
return request({
|
return request({
|
||||||
url: '/inventory/outer/vue/importData',
|
url: '/inventory/outer/vue/importData',
|
||||||
|
|
|
||||||
|
|
@ -546,7 +546,7 @@ export default {
|
||||||
tabs: [
|
tabs: [
|
||||||
{ label: '全部', name: 'all' },
|
{ label: '全部', name: 'all' },
|
||||||
{ label: '待处理', name: 'pending' },
|
{ label: '待处理', name: 'pending' },
|
||||||
{ label: '已通过', name: 'processed' },
|
{ label: '已处理', name: 'processed' },
|
||||||
{ label: '已归档', name: 'approved' },
|
{ label: '已归档', name: 'approved' },
|
||||||
{ label: '已驳回', name: 'returned' }
|
{ label: '已驳回', name: 'returned' }
|
||||||
],
|
],
|
||||||
|
|
@ -758,9 +758,9 @@ export default {
|
||||||
},
|
},
|
||||||
getApproveStatusLabel(row) {
|
getApproveStatusLabel(row) {
|
||||||
if (row.approveStatus === '1') {
|
if (row.approveStatus === '1') {
|
||||||
return this.isCurrentApproveUser(row) ? '待处理' : '已通过'
|
return this.isCurrentApproveUser(row) ? '待处理' : '已处理'
|
||||||
}
|
}
|
||||||
const map = { 2: '已通过', 3: '已驳回' }
|
const map = { 2: '已处理', 3: '已驳回' }
|
||||||
return map[row.approveStatus] || ''
|
return map[row.approveStatus] || ''
|
||||||
},
|
},
|
||||||
getApproveStatusTagType(row) {
|
getApproveStatusTagType(row) {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addDelivery, listProductSn } from '@/api/inventory/delivery';
|
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 PurchaseOrderSelectDialog from '../../../purchaseorder/components/PurchaseOrderSelectDialog.vue';
|
||||||
import {handleTree} from "@/utils/ruoyi";
|
import {handleTree} from "@/utils/ruoyi";
|
||||||
import { productMatchBindList } from '@/api/project/order';
|
import { productMatchBindList } from '@/api/project/order';
|
||||||
|
|
@ -270,7 +270,13 @@ export default {
|
||||||
this.selectedSnList = selection;
|
this.selectedSnList = selection;
|
||||||
},
|
},
|
||||||
handleDownloadTemplate() {
|
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;
|
const fileName = response.msg;
|
||||||
window.location.href = process.env.VUE_APP_BASE_API + "/common/download?fileName=" + encodeURIComponent(fileName) + "&delete=" + true;
|
window.location.href = process.env.VUE_APP_BASE_API + "/common/download?fileName=" + encodeURIComponent(fileName) + "&delete=" + true;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
|
|
||||||
|
|
@ -566,8 +566,9 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleLevel2TypeChange(level2Type) {
|
handleLevel2TypeChange(level2Type) {
|
||||||
// 产品类型为硬件时显示云终端配置
|
// 产品类型为硬件,且二级类型不是"硬件-配件"(dictValue=6)时,显示终端/国产化/CPU字段
|
||||||
if (this.form.type == 2) {
|
const isAccessory = level2Type == 6;
|
||||||
|
if (this.form.type == 2 && !isAccessory) {
|
||||||
this.level2TypeRelation = true;
|
this.level2TypeRelation = true;
|
||||||
// 显示时添加必填验证
|
// 显示时添加必填验证
|
||||||
this.rules.terminalType = [{ required: true, message: "终端类型不能为空", trigger: "change" }];
|
this.rules.terminalType = [{ required: true, message: "终端类型不能为空", trigger: "change" }];
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- 日志存放路径 -->
|
<!-- 日志存放路径 -->
|
||||||
<property name="log.path" value="/Users/jiliu/WorkSpace/java/RuoYi/logs" />
|
<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" />
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,14 @@ package com.ruoyi.sip.controller;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
||||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||||
|
import com.ruoyi.sip.service.IInventoryInfoService;
|
||||||
import com.ruoyi.sip.service.IOmsInventoryInnerService;
|
import com.ruoyi.sip.service.IOmsInventoryInnerService;
|
||||||
import com.ruoyi.sip.vo.OuterDeliveryVo;
|
import com.ruoyi.sip.vo.OuterDeliveryVo;
|
||||||
import com.ruoyi.sip.vo.OuterViewVo;
|
import com.ruoyi.sip.vo.OuterViewVo;
|
||||||
|
|
@ -18,6 +21,7 @@ import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.sip.domain.InventoryInfo;
|
||||||
import com.ruoyi.sip.domain.InventoryOuter;
|
import com.ruoyi.sip.domain.InventoryOuter;
|
||||||
import com.ruoyi.sip.service.IInventoryOuterService;
|
import com.ruoyi.sip.service.IInventoryOuterService;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
|
@ -41,6 +45,8 @@ public class InventoryOuterController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private IInventoryOuterService inventoryOuterService;
|
private IInventoryOuterService inventoryOuterService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IInventoryInfoService inventoryInfoService;
|
||||||
|
@Autowired
|
||||||
private IOmsInventoryInnerService innerService;
|
private IOmsInventoryInnerService innerService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IInventoryAuthService inventoryAuthService;
|
private IInventoryAuthService inventoryAuthService;
|
||||||
|
|
@ -161,6 +167,44 @@ public class InventoryOuterController extends BaseController
|
||||||
return util.importTemplateExcel("发货数据");
|
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")
|
@PostMapping("/importData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode
|
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode
|
||||||
|
|
|
||||||
|
|
@ -1287,7 +1287,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('finance_payment')
|
where tt.process_key in ('finance_payment')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
@ -1319,7 +1319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('finance_refund')
|
where tt.process_key in ('finance_refund')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
@ -1351,7 +1351,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('fianance_ticket')
|
where tt.process_key in ('fianance_ticket')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
@ -1383,7 +1383,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('finance_ticket_refound')
|
where tt.process_key in ('finance_ticket_refound')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
@ -1415,7 +1415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('finance_receipt_approve')
|
where tt.process_key in ('finance_receipt_approve')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
@ -1447,7 +1447,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('finance_receipt_refound')
|
where tt.process_key in ('finance_receipt_refound')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
@ -1479,7 +1479,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('finance_invoice_approve')
|
where tt.process_key in ('finance_invoice_approve')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
@ -1511,7 +1511,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join (
|
left join (
|
||||||
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
select business_key, count(1) as bu_todo_count from bu_todo as tt
|
||||||
where tt.process_key in ('finance_invoice_refound')
|
where tt.process_key in ('finance_invoice_refound')
|
||||||
<if test="approveUser != null and approveUser != "1" and !financeView">
|
<if test="approveUser != null and approveUser != "1"">
|
||||||
and tt.approve_user = #{approveUser}
|
and tt.approve_user = #{approveUser}
|
||||||
</if>
|
</if>
|
||||||
group by business_key
|
group by business_key
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue