From 2cdb87f043b0df14e69c5794c6a015027e11333b Mon Sep 17 00:00:00 2001 From: xd Date: Sat, 6 Jul 2024 14:38:58 +0800 Subject: [PATCH] 111 --- .../com/ruoyi/web/controller/quot/QuotController.java | 11 +++++++---- .../web/controller/redBook/RedBookController.java | 10 +++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index 56866f0..7145fc8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -834,20 +834,23 @@ public class QuotController extends BaseController } //下点超5.2 提醒 - BigDecimal tpxd = BigDecimal.ZERO; + BigDecimal tpxd = BigDecimal.ONE; List materials = quot.getQuotMaterialList(); if(materials!=null&&materials.size()>0){ - for(QuotMaterial quotMaterial:materials){ + /*for(QuotMaterial quotMaterial:materials){ BigDecimal matQuotTp = quotMaterial.getMatQuotTp(); if(BigDecimal.ZERO.compareTo(matQuotTp)<0){ tpxd = matQuotTp; break; } - } + }*/ + BigDecimal matQuotTp = materials.get(0).getMatQuotTp(); + tpxd = matQuotTp; } String matQuotTp = configService.selectConfigByKey("quot.allow.matQuotTp"); - if(tpxd.compareTo(new BigDecimal(matQuotTp))>0 && "0".equals(quot_oa_approval_status)){ + BigDecimal matQuotTp2 = BigDecimal.ONE.subtract(new BigDecimal(matQuotTp).divide(new BigDecimal("100"))); + if(tpxd.compareTo(matQuotTp2) < 0 && "0".equals(quot_oa_approval_status)){ return error("特批下点数超"+matQuotTp+"个点,请走OA审批流程"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java index 12a8be6..dff94ff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -269,7 +269,7 @@ public class RedBookController extends BaseController Quot xjquot = new Quot(); List materials = new ArrayList(); QuotMaterial xjquotMaterials = new QuotMaterial(); - File excelFile = null; + /*File excelFile = null;*/ try{ xjquot.setQuotId(UUID.fastUUID().toString()); String quotCode = redBookService.getCode("BJD"); @@ -285,7 +285,7 @@ public class RedBookController extends BaseController List list = quot.getSelectedResultData(); /** ===================================插入询价单明细表==================================*/ - /*for(OAQuotProduct op:list){ + for(OAQuotProduct op:list){ xjquotMaterials = new QuotMaterial(); xjquotMaterials.setMatXingh(op.getName_1());//型号 xjquotMaterials.setMatGuig(op.getSpec());//规格 @@ -301,12 +301,12 @@ public class RedBookController extends BaseController xjquotMaterials.setIndex(op.getIndex()); materials.add(xjquotMaterials); } - xjquot.setQuotMaterialList(materials);*/ + xjquot.setQuotMaterialList(materials); iQuotService.insertQuot(xjquot); /** ===================================插入询价单明细表==================================*/ /** ===================================产品明细生成附件==================================*/ - File directory = new File("xjQuotFile/"); + /*File directory = new File("xjQuotFile/"); // 如果文件夹不存在,则创建文件夹 if (!directory.exists()) { directory.mkdir(); @@ -344,7 +344,7 @@ public class RedBookController extends BaseController return error("系统异常,询价单号为空!"); } // 上传清单附件 - FileUtils.delete(excelFile); + FileUtils.delete(excelFile);*/ /** ===================================产品明细生成附件==================================*/ }catch(Exception e){ return error("系统异常");