Browse Source

2026-05-12

待报价清单【报价】优化
master
fengyuan_yang 1 month ago
parent
commit
f4534007aa
  1. 14
      src/main/java/com/spring/modules/quote/service/impl/QuoteServiceImpl.java
  2. 7
      src/main/resources/mapper/quotation/QuotationInformationMapper.xml

14
src/main/java/com/spring/modules/quote/service/impl/QuoteServiceImpl.java

@ -252,6 +252,8 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements
@Transactional
public List<Long> batchSaveQuoteByQuotation(List<QuotationInformationVo> list) {
List<Long> ids = new ArrayList<>();// 获取保存成功的报价单ID
// site 缓存下一个可用报价序号避免批量处理时重复扫描 plm_quote 获取最大号
Map<String, Integer> siteNextQuoteNoMap = new HashMap<>();
for (QuotationInformationVo quotation : list) {
if (Objects.isNull(quotation.getCurrency())){
throw new RuntimeException("币种不能为空");
@ -278,8 +280,16 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements
quote.setCreateDate(new Date());
quote.setQuoteDate(new Date());
// quote.setCustomerInquiryNo(quotation.getCustomer());
// 2获取报价单号
String quoteNo = Constant.BJ+baseMapper.queryQuoteNo(quote);
// 2获取报价单号按站点批量缓存起始号循环内递增
Integer nextQuoteNo = siteNextQuoteNoMap.get(quote.getSite());
if (Objects.isNull(nextQuoteNo)) {
Quote seedQuote = new Quote();
seedQuote.setSite(quote.getSite());
String quoteNoSeed = baseMapper.queryQuoteNo(seedQuote);
nextQuoteNo = StringUtils.hasText(quoteNoSeed) ? Integer.parseInt(quoteNoSeed) : 1;
}
String quoteNo = Constant.BJ + String.format("%08d", nextQuoteNo);
siteNextQuoteNoMap.put(quote.getSite(), nextQuoteNo + 1);
quote.setQuoteNo(quoteNo);
quote.setVersionNo("A001");
quote.setQuoteVersionNo(quote.getQuoteNo() + "-" + quote.getVersionNo());

7
src/main/resources/mapper/quotation/QuotationInformationMapper.xml

@ -285,7 +285,12 @@
left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and a.customer_no = pcpi.customer_no
<where>
a.site = #{query.site} and d.node_id = '400'
and a.quotation_no not in (select inside_inquiry_no from plm_quote where site = #{query.site})
and not exists (
select 1
from plm_quote
where site = #{query.site}
and inside_inquiry_no = a.quotation_no
)
<if test="query.createBy != null and query.createBy != ''">
and vpp.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(a.site, #{query.createBy}))
</if>

Loading…
Cancel
Save