|
|
@@ -16,6 +16,8 @@ import com.storlead.framework.mybatis.service.impl.MyBaseServiceImpl;
|
|
|
import com.storlead.knowledge.pojo.dto.ChatDTO;
|
|
|
import com.storlead.knowledge.service.ChatService;
|
|
|
import com.storlead.knowledge.service.WorkflowsService;
|
|
|
+import com.storlead.mail.pojo.entity.MktMailStatusEntity;
|
|
|
+import com.storlead.mail.service.MktMailStatusService;
|
|
|
import com.storlead.trade.dto.MarketEmailsDTO;
|
|
|
import com.storlead.trade.entity.*;
|
|
|
import com.storlead.trade.mapper.MarketEmailsMapper;
|
|
|
@@ -23,6 +25,7 @@ import com.storlead.trade.service.*;
|
|
|
import com.storlead.trade.vo.*;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
@@ -55,7 +58,7 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
@Resource
|
|
|
private CustomerTradeService customerTradeService;
|
|
|
@Resource
|
|
|
- @org.springframework.context.annotation.Lazy
|
|
|
+ @Lazy
|
|
|
private MarketingCampaignSopDetailService marketingCampaignSopDetailEntityService;
|
|
|
@Resource
|
|
|
private SopDetailService sopDetailService;
|
|
|
@@ -63,9 +66,12 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
private WorkflowsService workflowsService;
|
|
|
|
|
|
@Resource
|
|
|
- @org.springframework.context.annotation.Lazy
|
|
|
+ @Lazy
|
|
|
private MarketingCampaignService marketingCampaignService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private MktMailStatusService mktMailStatusService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public Result<Object> getList(MarketEmailsDTO dto) {
|
|
|
@@ -687,6 +693,32 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
return Result.ok(voList);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateCustomerEmailStatus(MarketEmailsCustomerVO marketEmailsCustomerVO) {
|
|
|
+ LambdaQueryWrapper<MarketEmailsEntity> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ if (!ObjectUtils.isEmpty(marketEmailsCustomerVO.getCustomerId())){
|
|
|
+ queryWrapper.eq(MarketEmailsEntity::getCustomerId, marketEmailsCustomerVO.getCustomerId());
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(marketEmailsCustomerVO.getMarketingCampaignId())){
|
|
|
+ queryWrapper.eq(MarketEmailsEntity::getMarketingCampaignId, marketEmailsCustomerVO.getMarketingCampaignId());
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(marketEmailsCustomerVO.getId())){
|
|
|
+ queryWrapper.eq(MarketEmailsEntity::getId, marketEmailsCustomerVO.getId());
|
|
|
+ }
|
|
|
+ queryWrapper.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0);
|
|
|
+ List<MarketEmailsEntity> entityList = this.list(queryWrapper);
|
|
|
+ List<Long> emailIdList = entityList.stream().map(MarketEmailsEntity::getEmailId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(emailIdList) && !ObjectUtils.isEmpty(marketEmailsCustomerVO.getStatus())){
|
|
|
+ LambdaUpdateWrapper<MktMailStatusEntity> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.in(MktMailStatusEntity::getId, emailIdList);
|
|
|
+ updateWrapper.set(MktMailStatusEntity::getSendStatus, marketEmailsCustomerVO.getStatus());
|
|
|
+ mktMailStatusService.update(null, updateWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void addSendTime(MarketingCampaignEntity marketingCampaignEntity) {
|