|
|
@@ -403,6 +403,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
if (status.equals(Constant.YES)) {
|
|
|
inquiryRemindDao.updateStatus(item.getSourceId(), Status.ALLOW.value(), item.getVendUU());
|
|
|
inquiryEnRemindDao.updateStatus(item.getSourceId(), Status.ALLOW.value(), item.getVendUU());
|
|
|
+ updatePurcInquiryItemAgreed(item.getSourceId(), status);
|
|
|
} else if (status.equals(Constant.NO)) {
|
|
|
inquiryRemindDao.updateStatus(item.getSourceId(), Status.NOTALLOW.value(), item.getVendUU());
|
|
|
inquiryEnRemindDao.updateStatus(item.getSourceId(), Status.NOTALLOW.value(), item.getVendUU());
|
|
|
@@ -432,6 +433,8 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
if (status.equals(Constant.YES)) {
|
|
|
inquiryRemindDao.updateStatus(item.getSourceId(), Status.ALLOW.value(), item.getVendUU());
|
|
|
inquiryEnRemindDao.updateStatus(item.getSourceId(), Status.ALLOW.value(), item.getVendUU());
|
|
|
+ // 修改询价明细agreed字段为1,表示存在已采纳报价明细
|
|
|
+ updatePurcInquiryItemAgreed(item.getSourceId(), status);
|
|
|
} else if (status.equals(Constant.NO)) {
|
|
|
inquiryRemindDao.updateStatus(item.getSourceId(), Status.NOTALLOW.value(), item.getVendUU());
|
|
|
inquiryEnRemindDao.updateStatus(item.getSourceId(), Status.NOTALLOW.value(), item.getVendUU());
|
|
|
@@ -446,6 +449,17 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
inquiryService.adoptMessage(item, InquirySource.MALL.name());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 更新询价单明细采纳状态
|
|
|
+ * @param id 询价单明细id
|
|
|
+ * @param agreed 采纳参数 1 或 0
|
|
|
+ */
|
|
|
+ private void updatePurcInquiryItemAgreed(Long id, short agreed) {
|
|
|
+ PurcInquiryItem inquiryItem = purcInquiryItemDao.findOne(id);
|
|
|
+ inquiryItem.setAgreed(agreed);
|
|
|
+ purcInquiryItemDao.save(inquiryItem);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 替代料报价采纳之后,添加替代料到询价企业对应物料
|
|
|
* @param item 报价明细
|
|
|
@@ -519,6 +533,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
if (status.equals(Constant.YES)) {
|
|
|
inquiryRemindDao.updateStatus(item.getSourceId(), Status.ALLOW.value(), item.getVendUU());
|
|
|
inquiryEnRemindDao.updateStatus(item.getSourceId(), Status.ALLOW.value(), item.getVendUU());
|
|
|
+ updatePurcInquiryItemAgreed(item.getSourceId(), status);
|
|
|
} else if (status.equals(Constant.NO)) {
|
|
|
inquiryRemindDao.updateStatus(item.getSourceId(), Status.NOTALLOW.value(), item.getVendUU());
|
|
|
inquiryEnRemindDao.updateStatus(item.getSourceId(), Status.NOTALLOW.value(), item.getVendUU());
|
|
|
@@ -949,4 +964,24 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
+ hours + " hour) and now() group by ir_venduu,ir_venduseruu";
|
|
|
return jdbcTemplate.query(sql, new BeanPropertyRowMapper<InquiryRemind>(InquiryRemind.class));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 讲报价产品数设置进page
|
|
|
+ *
|
|
|
+ * @param page 询价单page
|
|
|
+ * @return 询价单pege
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<PurcInquiry> setQuotedAmount(Page<PurcInquiry> page) {
|
|
|
+ for (PurcInquiry inquiry : page.getContent()) {
|
|
|
+ List<Long> itemIds = new ArrayList<>();
|
|
|
+ Long[] itemIdArray = new Long[inquiry.getInquiryItems().size()];
|
|
|
+ for (PurcInquiryItem item : inquiry.getInquiryItems()) {
|
|
|
+ itemIds.add(item.getId());
|
|
|
+ }
|
|
|
+ Integer size = itemDao.getQuotedAmountBySourceId(itemIds.toArray(itemIdArray));
|
|
|
+ inquiry.setQuotedAmount(size);
|
|
|
+ }
|
|
|
+ return page;
|
|
|
+ }
|
|
|
}
|