From 874990b2da259e13b0fd014cfff5fcd35a4be3b8 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 24 Jul 2024 11:26:34 +0800 Subject: [PATCH] '123' --- .../web/controller/quot/QuotController.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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 1fb9c91..9babd5e 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 @@ -4,6 +4,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -762,6 +763,27 @@ public class QuotController extends BaseController return error("金思维未协助完成,不能提交OA"); } + //厂价金额小于10万 不走OA审批 + BigDecimal tpxd = BigDecimal.ONE; + List materials = quot.getQuotMaterialList(); + if(materials!=null&&materials.size()>0){ + BigDecimal matQuotTp = materials.get(0).getMatQuotTp(); + if(matQuotTp == null || BigDecimal.ZERO.compareTo(matQuotTp)==0){ + matQuotTp = BigDecimal.ONE; + } + tpxd = matQuotTp; + } + + String allowFactoryPrice = configService.selectConfigByKey("quot:allow.factoryPrice"); + BigDecimal factoryPrice = new BigDecimal(allowFactoryPrice); + + String quotTotalPrice = quot.getQuotTotalPrice();//报价金额 + BigDecimal changj = new BigDecimal(quotTotalPrice).divide(tpxd,2,RoundingMode.HALF_UP);//厂价金额 + + if(changj.compareTo(factoryPrice)<0){ + return error("厂价金额不超过"+allowFactoryPrice+",无法提交OA审批"); + } + // 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material SysOaQuot sysOaQuot = new SysOaQuot(); SysOaQuot oauser = quotService.selectOAUserByUserName(getUsername());// 查询OA用户