|
|
@@ -6,6 +6,7 @@ import com.usoftchina.inquiry.api.InquiryApi;
|
|
|
import com.usoftchina.inquiry.po.inquiry.IPage;
|
|
|
import com.usoftchina.inquiry.po.inquiry.InquiryEnRemind;
|
|
|
import com.usoftchina.inquiry.po.inquiry.InquiryRemind;
|
|
|
+import com.usoftchina.inquiry.po.inquiry.PublicInquiryItem;
|
|
|
import com.usoftchina.saas.account.api.AccountApi;
|
|
|
import com.usoftchina.saas.account.api.CompanyApi;
|
|
|
import com.usoftchina.saas.base.Result;
|
|
|
@@ -34,9 +35,12 @@ import com.usoftchina.saas.sale.service.SaleService;
|
|
|
import com.usoftchina.saas.storage.po.ProdIODetail;
|
|
|
import com.usoftchina.saas.storage.po.ProdInOut;
|
|
|
import com.usoftchina.saas.utils.*;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.*;
|
|
|
@@ -75,6 +79,8 @@ public class SaleServiceImpl implements SaleService{
|
|
|
@Autowired
|
|
|
private CompanyApi companyApi;
|
|
|
|
|
|
+ private static final Logger LOGGER = LoggerFactory.getLogger(SaleServiceImpl.class);
|
|
|
+
|
|
|
@Override
|
|
|
public PageInfo<SaleList> getListData(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
|
|
|
PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
@@ -675,7 +681,7 @@ public class SaleServiceImpl implements SaleService{
|
|
|
Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
|
|
|
//Long userUU = 1000002503L, enUU = 10041559L;
|
|
|
IPage<InquiryEnRemind> inquiryEnRemindIPage = inquiryApi.findEnRemind(userUU, enUU, remindReqDTO.getPageNumber(),
|
|
|
- remindReqDTO.getPageSize(), remindReqDTO.getEnableOffer(), remindReqDTO.getKeyword(), /*remindReqDTO.getQuoted(),*/
|
|
|
+ remindReqDTO.getPageSize(), remindReqDTO.getEnableOffer(), remindReqDTO.getKeyword(), remindReqDTO.getQuoted(),
|
|
|
remindReqDTO.getFromDate(), remindReqDTO.getEndDate());
|
|
|
List<InquiryEnRemind> inquiryEnRemindList = inquiryEnRemindIPage.getContent();
|
|
|
if (CollectionUtils.isEmpty(inquiryEnRemindList)){
|
|
|
@@ -713,6 +719,23 @@ public class SaleServiceImpl implements SaleService{
|
|
|
return remindRspDTOIPage;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 报价
|
|
|
+ * @param publicInquiryItem
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String saveQuote(PublicInquiryItem publicInquiryItem) {
|
|
|
+ Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
|
|
|
+ Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
|
|
|
+ publicInquiryItem.setVendUU(enUU);
|
|
|
+ publicInquiryItem.setVendUserUU(userUU);
|
|
|
+ LOGGER.info("publicInquiryItem, {}", JsonUtils.toJsonString(publicInquiryItem));
|
|
|
+ ModelMap modelMap = inquiryApi.saveQuote(publicInquiryItem);
|
|
|
+ LOGGER.info("返回结果, ModelMap{}", JsonUtils.toJsonString(modelMap));
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 将平台返回的结果集转成SAAS的传输对象
|
|
|
* @param data
|
|
|
@@ -740,6 +763,15 @@ public class SaleServiceImpl implements SaleService{
|
|
|
}else{
|
|
|
remindRspDTO.setQuoted(1);
|
|
|
}
|
|
|
+ Long userUU = inquiryEnRemind.getInquiry().getRecorderUU();
|
|
|
+ remindRspDTO.setUserName(inquiryEnRemind.getUserName());
|
|
|
+ remindRspDTO.setUserTel(inquiryEnRemind.getUserTel());
|
|
|
+ remindRspDTO.setUserUU(userUU);
|
|
|
+ remindRspDTO.setSourceId(inquiryEnRemind.getItemId());
|
|
|
+ remindRspDTO.setEnUU(inquiryEnRemind.getEnUU());
|
|
|
+ remindRspDTO.setRecorderUU(userUU);
|
|
|
+ remindRspDTO.setInquiryCode(inquiryEnRemind.getCode());
|
|
|
+ remindRspDTO.setInquiryId(inquiryEnRemind.getId());
|
|
|
remindRspDTOList.add(remindRspDTO);
|
|
|
}
|
|
|
}else if("personal".equals(type)){
|
|
|
@@ -760,6 +792,15 @@ public class SaleServiceImpl implements SaleService{
|
|
|
}else{
|
|
|
remindRspDTO.setQuoted(1);
|
|
|
}
|
|
|
+ Long userUU = inquiryRemind.getInquiry().getRecorderUU();
|
|
|
+ remindRspDTO.setUserName(inquiryRemind.getUserName());
|
|
|
+ remindRspDTO.setUserTel(inquiryRemind.getUserTel());
|
|
|
+ remindRspDTO.setUserUU(userUU);
|
|
|
+ remindRspDTO.setSourceId(inquiryRemind.getItemId());
|
|
|
+ remindRspDTO.setEnUU(inquiryRemind.getEnUU());
|
|
|
+ remindRspDTO.setRecorderUU(userUU);
|
|
|
+ remindRspDTO.setInquiryCode(inquiryRemind.getCode());
|
|
|
+ remindRspDTO.setInquiryId(inquiryRemind.getId());
|
|
|
remindRspDTOList.add(remindRspDTO);
|
|
|
}
|
|
|
}
|