|
|
@ -228,6 +228,30 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements |
|
|
public List<Long> batchSaveQuoteByQuotation(QuotationInformationVo quotation) { |
|
|
public List<Long> batchSaveQuoteByQuotation(QuotationInformationVo quotation) { |
|
|
List<Long> ids = new ArrayList<>();// 获取保存成功的报价单ID |
|
|
List<Long> ids = new ArrayList<>();// 获取保存成功的报价单ID |
|
|
|
|
|
|
|
|
|
|
|
// 处理驳回询价单再次报价 |
|
|
|
|
|
InquiryApplicationData data = inquiryApplicationService.getById(quotation.getRfqId()); |
|
|
|
|
|
String quoteNo = ""; |
|
|
|
|
|
String versionNo = ""; |
|
|
|
|
|
String quoteVersionNo = ""; |
|
|
|
|
|
if ("D".equals(data.getStatus()) && StringUtils.hasText(data.getQuoteVersionNo())){ |
|
|
|
|
|
// 查询 原报价单号 |
|
|
|
|
|
Quote one = lambdaQuery() |
|
|
|
|
|
.eq(Quote::getSite, data.getSite()) |
|
|
|
|
|
.eq(Quote::getQuoteVersionNo, data.getQuoteVersionNo()) |
|
|
|
|
|
.one(); |
|
|
|
|
|
String str = one.getVersionNo().replace("A", ""); |
|
|
|
|
|
int value = 0; |
|
|
|
|
|
try { |
|
|
|
|
|
value = Integer.parseInt(str); |
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
throw new RuntimeException("程序异常"); |
|
|
|
|
|
} |
|
|
|
|
|
value ++; |
|
|
|
|
|
quoteNo = one.getQuoteNo(); |
|
|
|
|
|
versionNo = "A"+String.format("%03d",value); |
|
|
|
|
|
quoteVersionNo = one.getQuoteNo()+"-"+versionNo; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 将询价单数据保存到报价单 |
|
|
// 将询价单数据保存到报价单 |
|
|
Quote quote = new Quote(); |
|
|
Quote quote = new Quote(); |
|
|
// 1、获取bu和site |
|
|
// 1、获取bu和site |
|
|
@ -242,11 +266,15 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements |
|
|
quote.setCreateDate(new Date()); |
|
|
quote.setCreateDate(new Date()); |
|
|
quote.setQuoteDate(new Date()); |
|
|
quote.setQuoteDate(new Date()); |
|
|
quote.setCustomerInquiryNo(quotation.getCustomerInquiryNo()); |
|
|
quote.setCustomerInquiryNo(quotation.getCustomerInquiryNo()); |
|
|
|
|
|
quote.setQuoteNo(quoteNo); |
|
|
|
|
|
quote.setVersionNo(versionNo); |
|
|
|
|
|
quote.setQuoteVersionNo(quoteVersionNo); |
|
|
// 2、获取报价单号 |
|
|
// 2、获取报价单号 |
|
|
String quoteNo = baseMapper.queryQuoteNo(quote); |
|
|
|
|
|
quote.setQuoteNo("BJ" + quoteNo); |
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(quoteNo)){ |
|
|
|
|
|
quote.setQuoteNo("BJ" + baseMapper.queryQuoteNo(quote)); |
|
|
quote.setVersionNo("A001"); |
|
|
quote.setVersionNo("A001"); |
|
|
quote.setQuoteVersionNo(quote.getQuoteNo() + "-" + quote.getVersionNo()); |
|
|
quote.setQuoteVersionNo(quote.getQuoteNo() + "-" + quote.getVersionNo()); |
|
|
|
|
|
} |
|
|
quote.setCreateDate(new Date()); |
|
|
quote.setCreateDate(new Date()); |
|
|
// 3、 默认数据 |
|
|
// 3、 默认数据 |
|
|
quote.setCostModel("UFIDA"); |
|
|
quote.setCostModel("UFIDA"); |
|
|
@ -257,7 +285,7 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements |
|
|
|
|
|
|
|
|
// 将询价明细数据保存到报价明细 |
|
|
// 将询价明细数据保存到报价明细 |
|
|
for (QuotationInformationVo quotationInformationVo : quotation.getInquiryPartDataList()) { |
|
|
for (QuotationInformationVo quotationInformationVo : quotation.getInquiryPartDataList()) { |
|
|
//3、保存报价明细 |
|
|
|
|
|
|
|
|
// 3、保存报价明细 |
|
|
// 多个明细,可以放到循环当中 |
|
|
// 多个明细,可以放到循环当中 |
|
|
QuoteDetail detail = new QuoteDetail(); |
|
|
QuoteDetail detail = new QuoteDetail(); |
|
|
detail.setQuoteId(quote.getId()); |
|
|
detail.setQuoteId(quote.getId()); |
|
|
@ -327,10 +355,10 @@ public class QuoteServiceImpl extends ServiceImpl<QuoteMapper, Quote> implements |
|
|
groupDetail.setCostModel("2020"); |
|
|
groupDetail.setCostModel("2020"); |
|
|
QuoteDetail quoteDetail2 = quoteGroupDetailService.saveQuoteGroupDetail(groupDetail); |
|
|
QuoteDetail quoteDetail2 = quoteGroupDetailService.saveQuoteGroupDetail(groupDetail); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 更新询价单状态 A = 已报价 |
|
|
// 更新询价单状态 A = 已报价 |
|
|
inquiryApplicationService.lambdaUpdate() |
|
|
inquiryApplicationService.lambdaUpdate() |
|
|
.set(InquiryApplicationData::getStatus, "A") |
|
|
.set(InquiryApplicationData::getStatus, "A") |
|
|
|
|
|
.set(InquiryApplicationData::getQuoteVersionNo,quote.getQuoteVersionNo()) |
|
|
.eq(InquiryApplicationData::getId, quotation.getRfqId()) |
|
|
.eq(InquiryApplicationData::getId, quotation.getRfqId()) |
|
|
.update(); |
|
|
.update(); |
|
|
|
|
|
|
|
|
|