Jelajahi Sumber

添加邮件

YPZ 1 bulan lalu
induk
melakukan
70c95f63ec

+ 31 - 1
java/storlead-sasa/storlead-trade/src/main/java/com/storlead/trade/service/impl/MarketingCampaignSopDetailServiceImpl.java

@@ -96,6 +96,30 @@ public class MarketingCampaignSopDetailServiceImpl
         String fullCompanyAddress = "";
         List<SysDictDetailResponseDTO> sysDictDetailResponseDTOList = sysDictService.getListByCode("company_base");
         if (!CollectionUtils.isEmpty(sysDictDetailResponseDTOList)){
+            //取label为本地信息的value值
+            for (SysDictDetailResponseDTO sysDictDetailResponseDTO : sysDictDetailResponseDTOList) {
+                if ("yourName".equals(sysDictDetailResponseDTO.getLabel())) {
+                    yourName = sysDictDetailResponseDTO.getValue();
+                }
+                if ("yourTitle".equals(sysDictDetailResponseDTO.getLabel())) {
+                    yourTitle = sysDictDetailResponseDTO.getValue();
+                }
+                if ("yourCompany".equals(sysDictDetailResponseDTO.getLabel())) {
+                    yourTitle = sysDictDetailResponseDTO.getValue();
+                }
+                if ("yourPhone".equals(sysDictDetailResponseDTO.getLabel())) {
+                    yourPhone = sysDictDetailResponseDTO.getValue();
+                }
+                if ("yourEmail".equals(sysDictDetailResponseDTO.getLabel())) {
+                    yourEmail = sysDictDetailResponseDTO.getValue();
+                }
+                if ("本地信息".equals(sysDictDetailResponseDTO.getLabel())) {
+                    yourName = sysDictDetailResponseDTO.getValue();
+                }
+                if ("fullCompanyAddress".equals(sysDictDetailResponseDTO.getLabel())) {
+                    fullCompanyAddress = sysDictDetailResponseDTO.getValue();
+                }
+            }
 
         }
 
@@ -105,7 +129,13 @@ public class MarketingCampaignSopDetailServiceImpl
             CustomerVO customerEntity = customerEntityMap.get(marketEmailsEntity.getCustomerId());
             if (customerEntity != null) {
                 //修改emailContent中全部的${customerName}$为customerEntity.getCustomerName()
-                emailContent = emailContent.replace("${customerName}$", customerEntity.getCustomerName());
+                emailContent = emailContent.replace("${customerName}$", customerEntity.getCustomerName())
+                        .replace("${yourName}$", yourName)
+                        .replace("${yourTitle}$", yourTitle)
+                        .replace("${yourCompany}$", yourCompany)
+                        .replace("${yourPhone}$", yourPhone)
+                        .replace("${yourEmail}$", yourEmail)
+                        .replace("${fullCompanyAddress}$", fullCompanyAddress);
                 marketEmailsEntity.setContent(emailContent);
             }
             if (!ObjectUtils.isEmpty(marketEmailsEntity.getCustomerId()) && !ObjectUtils.isEmpty(customerEntityMap.get(marketEmailsEntity.getCustomerId()).getCustomerCompany()) && !ObjectUtils.isEmpty(customerEntityMap.get(marketEmailsEntity.getCustomerId()).getCustomerCompany().getEmail())){