diff --git a/src/main/java/com/xujie/sys/modules/quote/entity/QuoteDetail.java b/src/main/java/com/xujie/sys/modules/quote/entity/QuoteDetail.java index d03d7e78..ae60865e 100644 --- a/src/main/java/com/xujie/sys/modules/quote/entity/QuoteDetail.java +++ b/src/main/java/com/xujie/sys/modules/quote/entity/QuoteDetail.java @@ -216,6 +216,11 @@ public class QuoteDetail { @TableField(exist = false) private Long codeId; + @TableField(exist = false) + private BigDecimal weighted; + @TableField(exist = false) + private BigDecimal weighted2; + @TableField(exist = false) private List list; } diff --git a/src/main/java/com/xujie/sys/modules/reader/service/impl/ModbusCommunicateServiceImpl.java b/src/main/java/com/xujie/sys/modules/reader/service/impl/ModbusCommunicateServiceImpl.java index 0b64a7df..d4346128 100644 --- a/src/main/java/com/xujie/sys/modules/reader/service/impl/ModbusCommunicateServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/reader/service/impl/ModbusCommunicateServiceImpl.java @@ -62,6 +62,9 @@ public class ModbusCommunicateServiceImpl implements ModbusCommunicateService { List list = equipmentFolderLocationService.lambdaQuery().eq(EquipmentFolderLocation::getSuffix, "PLC").list(); log.info("PLC设备数量:{}",list.size()); // 创建线程池 + if (list.isEmpty()){ + return; + } ExecutorService executor = Executors.newFixedThreadPool(list.size()); for (EquipmentFolderLocation folderLocation : list) { executor.submit(()->{ diff --git a/src/main/resources/mapper/quote/QuoteDetailMapper.xml b/src/main/resources/mapper/quote/QuoteDetailMapper.xml index 07d94d73..4224a23f 100644 --- a/src/main/resources/mapper/quote/QuoteDetailMapper.xml +++ b/src/main/resources/mapper/quote/QuoteDetailMapper.xml @@ -70,7 +70,17 @@ qd.currency_total_cost1, qd.currency_total_cost2, qd.quote_currency_total_cost1, - qd.quote_currency_total_cost2 + qd.quote_currency_total_cost2, + IIF(qd.qty >= 250000 and + ((qd.currency1 = 'USD' and qd.exchange_rate1 > 0) or (qd.currency2 = 'USD' and exchange_rate2 > 0)) + , (qd.adjust_bom_un_yield + qd.adjust_labour_cost + qd.adjust_fabricate_cost + + qd.adjust_machine_cost) / IIF(qd.currency1 = 'USD', qd.exchange_rate1, qd.exchange_rate2) + , null) * qd.quote_profit_rate / 100 as weighted, + IIF(qd.qty >= 5000000 and + ((qd.currency1 = 'USD' and qd.exchange_rate1 > 0) or (qd.currency2 = 'USD' and exchange_rate2 > 0)) + , (qd.adjust_bom_un_yield + qd.adjust_labour_cost + qd.adjust_fabricate_cost + + qd.adjust_machine_cost) / IIF(qd.currency1 = 'USD', qd.exchange_rate1, qd.exchange_rate2) + , null) * qd.quote_profit_rate / 100 -1.5 as weighted2 from plm_quote_detail qd left join part pp on qd.part_id = pp.id