Przeglądaj źródła

feat:托管邮箱配置管理开发

chenjianhua 3 tygodni temu
rodzic
commit
6cf1d55ff8

+ 1 - 1
service-base/src/main/java/com/simuwang/base/mapper/daq/HostedEmailInfoMapper.java

@@ -11,7 +11,7 @@ import java.util.List;
 
 @Mapper
 public interface HostedEmailInfoMapper extends BaseMapper<HostedEmailInfoDO> {
-    HostedEmailInfoDO selectHostedEmailInfoDO(@Param("companyId") String companyId, @Param("email") String email);
+    HostedEmailInfoDO selectHostedEmailInfoDO(@Param("email") String email);
 
     void saveHostedEmailInfoDO(HostedEmailInfoDO hostedEmailInfoDO);
 

+ 4 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/EmailParseInfoDO.java

@@ -86,6 +86,9 @@ public class EmailParseInfoDO {
     @TableField(value = "review_status")
     private Integer reviewStatus;
 
+    @TableField(exist = false)
+    private String companyName;
+
     public EmailParseInfoVO toVO() {
         EmailParseInfoVO vo = new EmailParseInfoVO();
         vo.setEmail(this.email);
@@ -98,6 +101,7 @@ public class EmailParseInfoDO {
         vo.setParseDate(DateUtils.format(this.parseDate,DateUtils.YYYY_MM_DD_HH_MM_SS));
         vo.setId(this.id);
         vo.setReviewStatus(this.reviewStatus);
+        vo.setCompanyName(this.companyName);
         return vo;
     }
 }

+ 2 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/EmailParseInfoVO.java

@@ -56,4 +56,6 @@ public class EmailParseInfoVO {
     private String failReason;
 
     private Integer reviewStatus;
+
+    private String companyName;
 }

+ 58 - 2
service-base/src/main/resources/mapper/daq/EmailParseInfoMapper.xml

@@ -18,6 +18,7 @@
         <result column="updatetime" property="updateTime"/>
         <result column="sender_email" property="senderEmail"/>
         <result column="review_status" property="reviewStatus"/>
+        <result column="company_name" property="companyName"/>
     </resultMap>
 
 
@@ -96,8 +97,63 @@
         </where>
     </sql>
     <select id="searchEmailList" resultMap="BaseResultMap">
-        <include refid="selectEmailParse"/>
-        <include refid="sqlwhereSearch"/>
+        SELECT
+        epi.id,
+        epi.email,
+        pci.company_name,
+        epi.email_date,
+        epi.parse_date,
+        epi.email_title,
+        epi.email_type,
+        epi.parse_status,
+        epi.fail_reason,
+        epi.isvalid,
+        epi.creatorid,
+        epi.createtime,
+        epi.updatetime,
+        epi.updaterid,
+        epi.sender_email,
+        epi.review_status
+        FROM
+        email_parse_info epi
+        left join hosted_email_info hei
+        on hei.email = epi.sender_email and hei.isvalid=1
+        left join pvn_company_info pci
+        on pci.company_id = hei.company_id and pci.isvalid=1
+        where epi.isvalid=1
+        <if test="emailTitle !=null and emailTitle !=''">
+            and epi.email_title like concat('%',#{emailTitle},'%')
+        </if>
+        <if test="emailType !=null">
+            and epi.email_type = #{emailType}
+        </if>
+        <if test="reviewStatus !=null and reviewStatus != ''">
+            and epi.review_status = #{reviewStatus}
+        </if>
+        <if test="parseStatus !=null">
+            and epi.parse_status = #{parseStatus}
+        </if>
+        <if test="startDate !=null and startDate != ''">
+            and epi.parse_date <![CDATA[ >= ]]> #{startDate}
+        </if>
+        <if test="endDate !=null and endDate != ''">
+            and epi.parse_date <![CDATA[ <= ]]> #{endDate}
+        </if>
+        <if test="emailStartDate !=null and emailStartDate != ''">
+            and epi.email_date <![CDATA[ >= ]]> #{emailStartDate}
+        </if>
+        <if test="emailEndDate !=null and emailEndDate != ''">
+            and epi.email_date <![CDATA[ <= ]]> #{emailEndDate}
+        </if>
+        <if test="id !=null">
+            and epi.id = #{id}
+        </if>
+        <if test="email !=null and email !=''">
+            and epi.email like concat('%',#{email},'%')
+        </if>
+        <if test="senderEmail !=null and senderEmail !=''">
+            and epi.sender_email like concat('%',#{senderEmail},'%')
+        </if>
         <choose>
             <when test="sort != null and sort !='' and sort=='parseDate' and order != null and order !=''">
                 order by epi.parse_date ${order}

+ 1 - 1
service-base/src/main/resources/mapper/daq/HostedEmailInfoMapper.xml

@@ -38,7 +38,7 @@
         from hosted_email_info hei
         join pvn_company_info ci
         on ci.company_id = hei.company_id
-        where hei.isvalid=1 and ci.isvalid=1 and hei.company_id =#{companyId} and hei.email=#{email}
+        where hei.isvalid=1 and ci.isvalid=1 and hei.email=#{email}
     </select>
     <select id="searchHostEmailPage" resultMap="BaseResultMap">
         select hei.id,

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/service/impl/HostedEmailServiceImpl.java

@@ -36,10 +36,10 @@ public class HostedEmailServiceImpl implements HostedEmailService {
         hostedEmailInfoDO.setIsvalid(1);
         if(hostedEmailInfoDO.getId() == null){
             //判断渠道是否已经存在
-            HostedEmailInfoDO oldHostedEmailInfoDO = hostedEmailInfoMapper.selectHostedEmailInfoDO(hostedEmailInfoDO.getCompanyId(),hostedEmailInfoDO.getEmail());
+            HostedEmailInfoDO oldHostedEmailInfoDO = hostedEmailInfoMapper.selectHostedEmailInfoDO(hostedEmailInfoDO.getEmail());
             if(oldHostedEmailInfoDO != null){
                 vo.setCode(ResultCode.SAVE_FAILED.getCode());
-                vo.setMsg("托管机构邮箱已经存在无需添加");
+                vo.setMsg("托管邮箱已经存在无需添加");
                 vo.setData(false);
                 return vo;
             }