From 317e5db7c65a1f61d5527bfd63eb1e04653a8d1e Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Wed, 25 Jun 2025 09:05:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(product):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=97=E8=A1=A8=E5=92=8C=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除部分冗余代码 -改进价格格式化和计算逻辑 - 调整产品列表显示和选择功能 - 优化订单编辑界面布局 --- .../main/resources/templates/layout/product-list.html | 10 +++++----- .../ruoyi/sip/service/impl/ProjectInfoServiceImpl.java | 1 + .../sip/service/impl/ProjectOrderInfoServiceImpl.java | 4 ++-- .../service/impl/ProjectProductInfoServiceImpl.java | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/layout/product-list.html b/ruoyi-admin/src/main/resources/templates/layout/product-list.html index ecc3958a..4f87d88a 100644 --- a/ruoyi-admin/src/main/resources/templates/layout/product-list.html +++ b/ruoyi-admin/src/main/resources/templates/layout/product-list.html @@ -278,7 +278,7 @@ $('.productTable .catalogue-price-format').on('input', function () { let val = $(this).val() $(this).parent().parent().find('.cataloguePrice').val(val) - // let quantity = $(this).parent().parent().find('.quantity').val() + let quantity = $(this).parent().parent().find('.quantity').val() // let discount=$(this).parent().parent().find('.discount').val() // if (discount && val){ // $(this).parent().parent().find('.price').val((val * discount).toFixed(2)) @@ -290,10 +290,10 @@ // $(this).parent().parent().find('.allPrice-formmat').val(formatAmountNumber(allPrice)) // } // } - // if (quantity && val) { - // $(this).parent().parent().find('.catalogueAllPrice').val((val * quantity).toFixed(2)) - // $(this).parent().parent().find('.catalogueAllPrice-formmat').val(formatAmountNumber((val * quantity).toFixed(2))) - // } + if (quantity && val) { + $(this).parent().parent().find('.catalogueAllPrice').val((val * quantity).toFixed(2)) + $(this).parent().parent().find('.catalogueAllPrice-formmat').val(formatAmountNumber((val * quantity).toFixed(2))) + } }) $('.productTable .guidance-discount-format').on('input', function () { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java index d9330f19..9b0f9e6f 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java @@ -96,6 +96,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { projectInfo.setHardwareProjectProductInfoList(productListMap.get(ProductInfo.ProductTypeEnum.HARDWARE.getType())); List maintenanceProjectProductInfoList = productListMap.getOrDefault(ProductInfo.ProductTypeEnum.HARDWARE_MAINTENANCE.getType(), new ArrayList<>()); maintenanceProjectProductInfoList.addAll(productListMap.getOrDefault(ProductInfo.ProductTypeEnum.SOFTWARE_MAINTENANCE.getType(), new ArrayList<>())); + maintenanceProjectProductInfoList.addAll(productListMap.getOrDefault(ProductInfo.ProductTypeEnum.OTHER.getType(), new ArrayList<>())); projectInfo.setMaintenanceProjectProductInfoList(maintenanceProjectProductInfoList); //查询变更记录信息 List projectWorkProgresses = workProgressService.selectProjectWorkProgressListByProjectId(Collections.singletonList((projectInfo.getId()))); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java index 30afef56..15b0a237 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java @@ -171,12 +171,12 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService { } String shortCode = cnareas.get(0).getShortCode(); StringBuilder result = new StringBuilder(); - result.append("ZGXS-").append(currentDate).append(shortCode); + result.append("ZGXV-").append(currentDate).append(shortCode); // 查询当天已有的订单数量,用于生成顺序编码 int count = projectOrderInfoMapper.selectMaxOrderCode(result.toString()); // 生成顺序编码,不足三位补零 String sequence = String.format("%03d", count + 1); - result.append(sequence).append("-VDI"); + result.append(sequence); // 拼接订单编号 return result.toString(); } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java index 4b875c73..487910ba 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectProductInfoServiceImpl.java @@ -134,7 +134,7 @@ public class ProjectProductInfoServiceImpl implements IProjectProductInfoService List projectProductInfos = projectProductInfoMapper.selectProjectProductInfoListByProjectId(Collections.singletonList(list.get(0).getProjectId())); Set idSet = list.stream().map(ProjectProductInfo::getId).collect(Collectors.toSet()); - String[] deleteIds = projectProductInfos.stream().filter(item -> !idSet.contains(item.getId())).map(item -> item.getId().toString()).toArray(String[]::new); + String[] deleteIds = projectProductInfos.stream().filter(item -> !idSet.contains(item.getId())).map(item -> item.getId().toString()).toArray(String[]::new); //删除数据 if (deleteIds.length > 0) { projectProductInfoMapper.deleteProjectProductInfoByIds(deleteIds);