From 227eff61120aaca63e068035d745d86452e6499a Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期一, 17 八月 2026 09:35:12 +0800
Subject: [PATCH] feat(mes): 优化生产订单与排产任务列表显示,新增启停工及校验逻辑 1. 生产订单列表展示优化 (WorkOrder) - 新增「生产状态」列,全局注册 `ORDER_PRODUCTION_STATUS` 常量并绑定系统动态字典。 - 彻底重构「工序生产进度」单元格显示:弃用臃肿的 Steps 组件,改为极简横向布局(彩色状态圆点 + 进度百分比),解决表格行高被强行撑开及内容截断问题,支持横向滚动。 - 优化「完成进度」列宽及展示样式,将百分比数值外置同行显示,更加直观。 2. 排产任务列表改造 (Task) - 顶部表头重构,由单一标题重构为「全部 / 未完成 / 已完成」的 Tabs 标签页切换结构。 - 重写数据过滤逻辑,剥离写死的 status 查询,改为使用 `scheduleStatus` 字段动态响应 Tabs 切换 (0: 未完成, 1: 已完成)。 3. 工单业务逻辑增强与状态流转 - 落实「工单查询逻辑设计方案」,优化底层的工单条件检索逻辑。 - 实现「添加工单启停功能」与「停工状态」,支持工单在执行过程中的暂停与恢复业务流转。 - 强化容错与防呆设计:操作「完成订单」时增加前置校验 `handleCheckFinish`,若生产状态为未完成,强制弹出二次确认 Modal,避免误操作。 # 相关讨论/参考方案 # - 添加工单启停功能 # - 停工状态功能设计方案 # - 工单查询逻辑设计方案 # - 工单完成进度显示优化
---
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/ErpFinancePaymentController.java | 64 +++++++++++++++++++++++++------
1 files changed, 51 insertions(+), 13 deletions(-)
diff --git a/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/ErpFinancePaymentController.java b/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/ErpFinancePaymentController.java
index 09e2469..e24d92f 100644
--- a/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/ErpFinancePaymentController.java
+++ b/yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/ErpFinancePaymentController.java
@@ -12,13 +12,17 @@
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment.ErpFinancePaymentPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment.ErpFinancePaymentRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment.ErpFinancePaymentSaveReqVO;
+import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.invoice.ErpPurchaseInvoiceRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpAccountDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.finance.ErpFinancePaymentItemDO;
-import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpSupplierDO;
+import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInvoiceDO;
+import cn.iocoder.yudao.module.srm.api.supplier.SrmSupplierApi;
+import cn.iocoder.yudao.module.srm.api.supplier.dto.SrmSupplierRespDTO;
import cn.iocoder.yudao.module.erp.service.finance.ErpAccountService;
import cn.iocoder.yudao.module.erp.service.finance.ErpFinancePaymentService;
-import cn.iocoder.yudao.module.erp.service.purchase.ErpSupplierService;
+import cn.iocoder.yudao.module.erp.service.purchase.ErpPurchaseInvoiceService;
+import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
@@ -39,6 +43,7 @@
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
+import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "绠$悊鍚庡彴 - ERP 浠樻鍗�")
@RestController
@@ -49,12 +54,16 @@
@Resource
private ErpFinancePaymentService financePaymentService;
@Resource
- private ErpSupplierService supplierService;
+ private SrmSupplierApi srmSupplierApi;
@Resource
private ErpAccountService accountService;
+ @Resource
+ private ErpPurchaseInvoiceService invoiceService;
@Resource
private AdminUserApi adminUserApi;
+ @Resource
+ private StorageAttachmentApi storageAttachmentApi;
@PostMapping("/create")
@Operation(summary = "鍒涘缓浠樻鍗�")
@@ -71,13 +80,21 @@
return success(true);
}
- @PutMapping("/update-status")
- @Operation(summary = "鏇存柊浠樻鍗曠殑鐘舵��")
- @PreAuthorize("@ss.hasPermission('erp:finance-payment:update-status')")
- public CommonResult<Boolean> updateFinancePaymentStatus(@RequestParam("id") Long id,
- @RequestParam("status") Integer status) {
- financePaymentService.updateFinancePaymentStatus(id, status);
+ @PostMapping("/submit")
+ @Operation(summary = "鎻愪氦浠樻鍗曞鎵�")
+ @PreAuthorize("@ss.hasPermission('erp:finance-payment:update')")
+ public CommonResult<Boolean> submitFinancePayment(@RequestParam("id") Long id,
+ @RequestParam("processDefinitionKey") String processDefinitionKey) {
+ Long userId = getLoginUserId();
+ financePaymentService.submitFinancePayment(id, processDefinitionKey, userId);
return success(true);
+ }
+
+ @GetMapping("/approve-process-list")
+ @Operation(summary = "鑾峰彇浠樻鍗曞鎵规祦绋嬪垪琛�")
+ @PreAuthorize("@ss.hasPermission('erp:finance-payment:query')")
+ public CommonResult<List<Map<String, Object>>> getApproveProcessList() {
+ return success(financePaymentService.getFinancePaymentApproveProcessDefinitionList());
}
@DeleteMapping("/delete")
@@ -99,8 +116,23 @@
return success(null);
}
List<ErpFinancePaymentItemDO> paymentItemList = financePaymentService.getFinancePaymentItemListByPaymentId(id);
- return success(BeanUtils.toBean(payment, ErpFinancePaymentRespVO.class, financePaymentVO ->
- financePaymentVO.setItems(BeanUtils.toBean(paymentItemList, ErpFinancePaymentRespVO.Item.class))));
+ return success(buildFinancePaymentVO(payment, paymentItemList));
+ }
+
+ private ErpFinancePaymentRespVO buildFinancePaymentVO(ErpFinancePaymentDO payment,
+ List<ErpFinancePaymentItemDO> paymentItemList) {
+ ErpPurchaseInvoiceRespVO invoiceVO = null;
+ if (payment.getInvoiceId() != null) {
+ ErpPurchaseInvoiceDO invoice = invoiceService.getPurchaseInvoice(payment.getInvoiceId());
+ if (invoice != null) {
+ invoiceVO = BeanUtils.toBean(invoice, ErpPurchaseInvoiceRespVO.class);
+ }
+ }
+ ErpPurchaseInvoiceRespVO invoiceFinal = invoiceVO;
+ return BeanUtils.toBean(payment, ErpFinancePaymentRespVO.class, financePaymentVO ->
+ financePaymentVO.setInvoice(invoiceFinal)
+ .setItems(BeanUtils.toBean(paymentItemList, ErpFinancePaymentRespVO.Item.class))
+ .setAttachmentList(storageAttachmentApi.listAttachments("erp_finance_payment", payment.getId())));
}
@GetMapping("/page")
@@ -132,14 +164,18 @@
convertSet(pageResult.getList(), ErpFinancePaymentDO::getId));
Map<Long, List<ErpFinancePaymentItemDO>> financePaymentItemMap = convertMultiMap(paymentItemList, ErpFinancePaymentItemDO::getPaymentId);
// 1.2 渚涘簲鍟嗕俊鎭�
- Map<Long, ErpSupplierDO> supplierMap = supplierService.getSupplierMap(
- convertSet(pageResult.getList(), ErpFinancePaymentDO::getSupplierId));
+ Map<Long, SrmSupplierRespDTO> supplierMap = srmSupplierApi.getSupplierList(
+ convertSet(pageResult.getList(), ErpFinancePaymentDO::getSupplierId)).getCheckedData().stream()
+ .collect(java.util.stream.Collectors.toMap(SrmSupplierRespDTO::getId, v -> v, (a, b) -> a));
// 1.3 缁撶畻璐︽埛淇℃伅
Map<Long, ErpAccountDO> accountMap = accountService.getAccountMap(
convertSet(pageResult.getList(), ErpFinancePaymentDO::getAccountId));
// 1.4 绠$悊鍛樹俊鎭�
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(convertListByFlatMap(pageResult.getList(),
contact -> Stream.of(NumberUtils.parseLong(contact.getCreator()), contact.getFinanceUserId())));
+ // 1.5 鏉ョエ淇℃伅
+ Map<Long, ErpPurchaseInvoiceDO> invoiceMap = invoiceService.getPurchaseInvoiceMap(
+ convertSet(pageResult.getList(), ErpFinancePaymentDO::getInvoiceId));
// 2. 寮�濮嬫嫾鎺�
return BeanUtils.toBean(pageResult, ErpFinancePaymentRespVO.class, payment -> {
payment.setItems(BeanUtils.toBean(financePaymentItemMap.get(payment.getId()), ErpFinancePaymentRespVO.Item.class));
@@ -147,6 +183,8 @@
MapUtils.findAndThen(accountMap, payment.getAccountId(), account -> payment.setAccountName(account.getName()));
MapUtils.findAndThen(userMap, Long.parseLong(payment.getCreator()), user -> payment.setCreatorName(user.getNickname()));
MapUtils.findAndThen(userMap, payment.getFinanceUserId(), user -> payment.setFinanceUserName(user.getNickname()));
+ MapUtils.findAndThen(invoiceMap, payment.getInvoiceId(), invoice ->
+ payment.setInvoice(BeanUtils.toBean(invoice, ErpPurchaseInvoiceRespVO.class)));
});
}
--
Gitblit v1.9.3