unis_sip/.workbuddy/memory/2026-09-08.md

53 lines
5.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 2026-09-08
## 代码 review两轮
用户要求只 review 不改代码。范围:工作区 53 个改动文件Java 后端 + Vue 前端)。
### 改动主体
- Excel 注解新增 `decimalFormat` 字段Excel.java + ExcelUtil.java21 个 domain 的 BigDecimal 字段加 `@Excel(scale=2, decimalFormat="#,##0.00")`,仅影响导出显示,安全。
- 前端多处 `toFixed(2)` → 全局 `formatCurrency`main.js 已注册 Vue.prototype安全。
- ProductInfo/Mapper/前端新增 `pre_system_type`(预装系统类型)字段,前后端配套完整,配套 SQL`sql/20290904update.sql`(文件名年份疑为笔误,写的是 2029
- `OmsInventoryInnerServiceImpl.insertOmsInventoryInner` 应付单生成逻辑重构(核心风险点)。
### 第一轮发现的问题 → 用户修复后第二轮复核结果
1. NPEquantity/price 为 null 时直接 multiply→ 已修:`usePurchaseOrder` 条件含 null 检查null 时回退原公式 ✓
2. 重复 setTaxAmount新旧两行并存→ 已清理,只留正确行(含税-未税)✓
3. vendorInfo 为 null 时 getPayConfigDay() NPE → 已修,传 0 ✓
4. 遗留:`vendorInfo != null ? vendorInfo.getPayConfigDay() : 0` 三元混合 Integer/intpayConfigDay 为 null 时仍会拆箱 NPE原代码同样会炸非回归
5. 遗留ExcelUtil 每单元格 createCellStylePOI 上限 64000 样式,大数据量导出会失败
6. 遗留OrderList.java 文件末尾无换行oms_web/.DS_Store 未跟踪垃圾文件
### 业务逻辑一致性结论H3C 判定)
- 新华三isH3C=truestartsWith("新华三")):条件退化为原条件,金额公式走原逻辑,与原 100% 一致
- 非新华三无采购单innerComplete 默认 true与原一致
### 第三轮复核(用户又修复了一批)
1. 三元拆箱 NPE → 已修:`vendorInfo != null && vendorInfo.getPayConfigDay() != null ? ... : 0` ✓
2. ExcelUtil CellStyle → 已修:新增 `moneyStyles` Map 缓存(按 decimalFormat 键HashMap 已导入ExcelUtil 每次 export 新建实例,缓存作用域正确 ✓
3. OrderList.java 末尾换行 → 已补 ✓
仍遗留(非代码 bug提交时注意isH3C 口径需业务确认startsWith("新华三"),基于 ProductInfo.vendorNamesql/20290904update.sql 文件名年份笔误(2029)oms_web/.DS_Store 与 ruoyi-admin/.DS_Store 垃圾文件。
至此所有代码级问题均已修复H3C/无采购单场景与原逻辑一致,非新华三+有采购单为有意业务变更。
### 金额格式统一专项检查(第四轮,只查不改)
**统一现状**:全局 formatCurrencyutils/index.js:17main.js:46 注册null→'0.00'toLocaleString en-US 2位小数本次 diff 新增 72 处 formatCurrency27 个文件);后端 21 个 domain 106 个 @Excel 字段加 decimalFormat。
**后端 Excel 遗漏**OmsTicketBill.java:70 taxAmount税额活动注解其余单据均已加。比率类taxRate×4、planRate×2、invoiceRate、receiptRate未加属合理折扣类OrderList.discount、ProjectOrderConfigInfo.guidanceDiscount/discount需确认语义。
**前端遗漏**ApplyInvoice.vue:122/129/143 v-else 分支裸显示 unitPrice/amount/taxAmountwriteoff 两 index 的 $modal 提示文案 5 处无千分位轻微formatCurrency(x.toFixed(2)) 双重格式化 ~12 处(冗余无害)。
**体系性发现**:项目存在 7+ 处组件局部 formatAmount/formatAmountNumber 副本均为存量非本次新增purchaseorder/index.vue:589、orderFinance.vue:377(filters)、base/quotation/index.vue:535、ProductConfig.vue:497、approve/all/index.vue:1295(用zh-CN)、projectTransfer.vue:293、project/info/index.vue:491 等。差异:局部版 null→'',全局版 null→'0.00'。后续统一建议收敛到全局 formatCurrency先定 null 显示口径。
**formatCurrency 边界**:非数字字符串入参会显示 "NaN"Number('abc').toLocaleString → "NaN"),建议加 Number.isNaN 保护。convertCurrency大写金额依赖 toFixed 字符串InvoiceInfoView:115 / ApplyInvoice:278 / invoiceExcelUtils.js:147 的 toFixed(2) 必须保留,不是遗漏。
### 第五轮全量改动集成测试mvn 编译 + vue 解析)
**Maven 全量编译**JAVA_HOME=Corretto 87 模块 SUCCESS0 ERROR。Lombok、@Excel 注解、mapper SQL、Service 实现全部对齐。
**前端 31 文件 SFC/JS 解析**:用 @vue/compiler-sfc 批量 parse0 失败PaymentRefundDetail、ReceiptDetail、ReceivableInvoiceDetail、ApplyInvoice、InvoiceInfoView、EditForm×2、AddForm、receipt/index、writeoff 6 个文件、inventory/inner、ProductConfig、ProjectForm、project/info/index、OrderDetail、PurchaseOrderDetail、PurchaseOrderDetailView、PurchaseOrderSelectDialog、vendorConfirm、system/product、approve/purchaase×2、selectQuotation、projectTransfer、invoiceExcelUtils.js
**本轮新增发现的位置**(前几轮未深查):
- ruoyi-admin/logback.xml把 jiliu 路径换成 kangwenjing 个人本地路径,纯个人配置切换,不影响代码(提交前建议恢复或加 .gitignore 排除)。
- dto/InventoryInfoExcelDto.java、dto/warehouse/WarehouseInnerExcelDto.javainnerPrice 加 decimalFormat已正确 ✓
- approve/purchaase/{approve,approved}/index.vue含税总金额列加 formatter ✓
- base/quotation/selectQuotation.vuediscountAmount 加 formatter字段名语义为"报价金额"QuotationInfo 表的折扣后金额),没问题 ✓
- system/product/index.vuequeryParams 已在 data() 初始声明 preSystemType: null ✓resetForm 依赖表单模板自动重置 ✓handleTypeChange 在切换非硬件时清空 preSystemType ✓
- OmsTicketBill.java:70 税额仍**漏** decimalFormat连续两轮没修