YPZ 4 тижнів тому
батько
коміт
4447ef0b26

+ 11 - 0
java/storlead-sasa/storlead-trade/src/main/java/com/storlead/trade/controller/MarketEmailsController.java

@@ -1,6 +1,7 @@
 package com.storlead.trade.controller;
 
 import com.storlead.trade.dto.MarketEmailsDTO;
+import com.storlead.trade.entity.MarketEmailsEntity;
 import com.storlead.trade.service.MarketEmailsService;
 import com.storlead.framework.common.result.Result;
 import com.storlead.trade.vo.MarketEmailsManagementVO;
@@ -114,6 +115,16 @@ public class MarketEmailsController {
         return Result.result(marketEmailsService.getById(id));
     }
 
+    @PostMapping("/editContent")
+    @ApiOperation("营销: 营销邮件修改内容和主题")
+    public Result<?> editContent(@RequestBody MarketEmailsEntity marketEmailsEntity) {
+        boolean isOk = marketEmailsService.updateById(marketEmailsEntity);
+        if (!isOk) {
+            return Result.error("修改失败");
+        }
+        return Result.ok();
+    }
+
     @GetMapping("/management-detail")
     @ApiOperation("营销: 邮件管理弹窗(按 marketingCampaignId 查询所有邮件卡片)")
     public Result<Object> managementDetail(Long id) {

+ 8 - 0
java/storlead-sasa/storlead-trade/src/main/java/com/storlead/trade/dto/MarketEmailsDTO.java

@@ -75,4 +75,12 @@ public class MarketEmailsDTO extends Page {
     @JSONField(format ="yyyy-MM-dd HH:mm:ss")
     @TableField("first_open_time")
     private Date firstOpenTime;
+
+    @ApiModelProperty("主题")
+    @TableField("subject")
+    private String subject;
+
+    @ApiModelProperty(value = "邮件内容")
+    @TableField("content")
+    private String content;
 }

+ 1 - 0
java/storlead-sasa/storlead-trade/src/main/java/com/storlead/trade/service/impl/MarketEmailsServiceImpl.java

@@ -372,6 +372,7 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
         if (!ok) {
             return Result.error("操作失败");
         }
+        //如果是重发,判断时间如果小于当前时间,直接发送
         return Result.ok();
     }
 

+ 9 - 5
java/storlead-sasa/storlead-trade/src/main/java/com/storlead/trade/service/impl/MarketingCampaignSopDetailServiceImpl.java

@@ -11,10 +11,7 @@ import com.storlead.mail.service.MktMailMessageService;
 import com.storlead.trade.dto.CustomerDTO;
 import com.storlead.trade.dto.MarketingCampaignSopDetailDTO;
 import com.storlead.trade.dto.SysDictDetailResponseDTO;
-import com.storlead.trade.entity.CustomerEntity;
-import com.storlead.trade.entity.MarketEmailsEntity;
-import com.storlead.trade.entity.MarketingCampaignSopDetailEntity;
-import com.storlead.trade.entity.SysDictDetailEntity;
+import com.storlead.trade.entity.*;
 import com.storlead.trade.mapper.MarketingCampaignSopDetailMapper;
 import com.storlead.trade.service.*;
 import com.storlead.trade.service.impl.support.TradeDataSourceServiceImpl;
@@ -127,12 +124,19 @@ public class MarketingCampaignSopDetailServiceImpl
             marketEmailsEntity.setStatus(-1);
             CustomerVO customerEntity = customerEntityMap.get(marketEmailsEntity.getCustomerId());
             if (customerEntity != null) {
+                if (ObjectUtils.isEmpty(customerEntity.getCustomerCompany())) {
+                    customerEntity.setCustomerCompany(new CustomerCompanyEntity());
+                }
 
 //                ${areaName}$、${customerIndustry}$
                 //修改emailContent中全部的${customerName}$为customerEntity.getCustomerName()
+                String industry = "";
+                if (!ObjectUtils.isEmpty(customerEntity.getCustomerCompany().getIndustry())){
+                    industry = customerEntity.getCustomerCompany().getIndustry();
+                }
                 emailContent = emailContent.replace("${customerName}$", customerEntity.getCustomerName())
                         .replace("${areaName}$", customerEntity.getCountry())
-                        .replace("${customerIndustry}$", customerEntity.getCustomerCompany().getIndustry())
+                        .replace("${customerIndustry}$", industry)
                         .replace("${yourName}$", yourName)
                         .replace("${yourTitle}$", yourTitle)
                         .replace("${yourCompany}$", yourCompany)