diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/MailEtlController.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/MailEtlController.java new file mode 100644 index 0000000..9f97da6 --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/MailEtlController.java @@ -0,0 +1,82 @@ +package com.biutag.outeradmin.controller; + + +import com.alibaba.fastjson2.JSON; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.outeradmin.dto.*; +import com.biutag.outeradmin.entity.Mail; +import com.biutag.outeradmin.entity.Mail_etl; +import com.biutag.outeradmin.entity.Mail_evaluate_etl; +import com.biutag.outeradmin.mapper.Mail_EtlMapper; +import com.biutag.outeradmin.mapper.Mail_Eva_EtlMapper; +import com.biutag.outeradmin.service.MailEtlService; + +import com.biutag.outeradmin.util.DesensitizedUtil; +import com.biutag.util.StringUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("/mailetl") +@RestController +public class MailEtlController { + + private final MailEtlService mailEtlService; + private final Mail_EtlMapper mail_EtlMapper; + private final Mail_Eva_EtlMapper mail_eva_etlMapper; + @RequestMapping("/list-submit") + public Mail_etlPageInfo siftList(@RequestBody String form) { + MailEtlFormPage mailetlFormPage = JSON.parseObject(form, MailEtlFormPage.class); + MailEtlFormData mailetlFormData = mailetlFormPage.getFormData(); + if (mailetlFormPage.getSelectData().equals("mail_etl")){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (mailetlFormData.getMailId()!=null){ + queryWrapper.lambda().like(Mail_etl::getMailId, mailetlFormData.getMailId()); + } + if (mailetlFormData.getSuccess()!=null){ + queryWrapper.lambda().eq(Mail_etl::getSuccess, mailetlFormData.getSuccess()); + } + if (mailetlFormData.getId()!=null){ + queryWrapper.lambda().eq(Mail_etl::getId, mailetlFormData.getId()); + } + + PageSet pageSet = mailetlFormPage.getPageData(); + Page page = new Page<>(pageSet.getCurrentPage(), pageSet.getPageSize()); + List mailetlPage = mail_EtlMapper.selectPage(page, queryWrapper).getRecords(); + pageSet.setTotalSize((int) page.getTotal()); + Mail_etlPageInfo result = new Mail_etlPageInfo(); + result.setMails(mailetlPage); + result.setPageSet(pageSet); + return result; + }else{ + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (mailetlFormData.getMailId()!=null){ + queryWrapper.lambda().like(Mail_evaluate_etl::getMailId, mailetlFormData.getMailId()); + } + if (mailetlFormData.getSuccess()!=null){ + queryWrapper.lambda().eq(Mail_evaluate_etl::getSuccess, mailetlFormData.getSuccess()); + } + if (mailetlFormData.getId()!=null){ + queryWrapper.lambda().eq(Mail_evaluate_etl::getId, mailetlFormData.getId()); + } + + PageSet pageSet = mailetlFormPage.getPageData(); + Page page = new Page<>(pageSet.getCurrentPage(), pageSet.getPageSize()); + List mailetlPage = mail_eva_etlMapper.selectPage(page, queryWrapper).getRecords(); + pageSet.setTotalSize((int) page.getTotal()); + Mail_etlPageInfo result = new Mail_etlPageInfo(); + result.setEvaMails(mailetlPage); + result.setPageSet(pageSet); + return result; + } + + + } +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/MailEtlFormData.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/MailEtlFormData.java new file mode 100644 index 0000000..e9d725d --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/MailEtlFormData.java @@ -0,0 +1,14 @@ +package com.biutag.outeradmin.dto; + + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class MailEtlFormData { + private Integer id; + private String mailId; + private Boolean success; +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/MailEtlFormPage.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/MailEtlFormPage.java new file mode 100644 index 0000000..f2ed79b --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/MailEtlFormPage.java @@ -0,0 +1,11 @@ +package com.biutag.outeradmin.dto; + +import lombok.Data; + +@Data +public class MailEtlFormPage { + private MailEtlFormData formData; + private String selectData; + private PageSet pageData; + +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/Mail_EvaEtlPageInfo.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/Mail_EvaEtlPageInfo.java new file mode 100644 index 0000000..521cf24 --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/Mail_EvaEtlPageInfo.java @@ -0,0 +1,13 @@ +package com.biutag.outeradmin.dto; + +import com.biutag.outeradmin.entity.Mail_etl; +import com.biutag.outeradmin.entity.Mail_evaluate_etl; +import lombok.Data; + +import java.util.List; + +@Data +public class Mail_EvaEtlPageInfo { + private List mails; + private PageSet pageSet; +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/Mail_etlPageInfo.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/Mail_etlPageInfo.java new file mode 100644 index 0000000..71bbd9a --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/dto/Mail_etlPageInfo.java @@ -0,0 +1,15 @@ +package com.biutag.outeradmin.dto; + +import com.biutag.outeradmin.entity.Mail; +import com.biutag.outeradmin.entity.Mail_etl; +import com.biutag.outeradmin.entity.Mail_evaluate_etl; +import lombok.Data; + +import java.util.List; + +@Data +public class Mail_etlPageInfo { + private List mails; + private List evaMails; + private PageSet pageSet; +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/entity/Mail_etl.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/entity/Mail_etl.java new file mode 100644 index 0000000..9814a92 --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/entity/Mail_etl.java @@ -0,0 +1,23 @@ +package com.biutag.outeradmin.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.sql.Timestamp; +import java.util.Date; + +@Data +@TableName("mail_etl") +public class Mail_etl { + @TableId + private Integer id; + + private String mailId; + + private Boolean success; + + private Date createTime; + + private String errMsg; +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/entity/Mail_evaluate_etl.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/entity/Mail_evaluate_etl.java new file mode 100644 index 0000000..0862ded --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/entity/Mail_evaluate_etl.java @@ -0,0 +1,22 @@ +package com.biutag.outeradmin.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("mail_evaluate_etl") +public class Mail_evaluate_etl { + @TableId + private Integer id; + + private String mailId; + + private Boolean success; + + private Date createTime; + + private String errMsg; +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/mapper/Mail_EtlMapper.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/mapper/Mail_EtlMapper.java new file mode 100644 index 0000000..f119ce5 --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/mapper/Mail_EtlMapper.java @@ -0,0 +1,10 @@ +package com.biutag.outeradmin.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.outeradmin.entity.Mail; +import com.biutag.outeradmin.entity.Mail_etl; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface Mail_EtlMapper extends BaseMapper { +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/mapper/Mail_Eva_EtlMapper.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/mapper/Mail_Eva_EtlMapper.java new file mode 100644 index 0000000..39f1b09 --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/mapper/Mail_Eva_EtlMapper.java @@ -0,0 +1,10 @@ +package com.biutag.outeradmin.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.outeradmin.entity.Mail_etl; +import com.biutag.outeradmin.entity.Mail_evaluate_etl; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface Mail_Eva_EtlMapper extends BaseMapper { +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/service/MailEtlService.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/service/MailEtlService.java new file mode 100644 index 0000000..33e4939 --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/service/MailEtlService.java @@ -0,0 +1,11 @@ +package com.biutag.outeradmin.service; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.outeradmin.entity.Mail_etl; +import com.biutag.outeradmin.mapper.Mail_EtlMapper; +import org.springframework.stereotype.Service; + +@Service +public class MailEtlService extends ServiceImpl { +} diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/service/MailEvaEtlService.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/service/MailEvaEtlService.java new file mode 100644 index 0000000..cc2932c --- /dev/null +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/service/MailEvaEtlService.java @@ -0,0 +1,13 @@ +package com.biutag.outeradmin.service; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.outeradmin.entity.Mail_etl; +import com.biutag.outeradmin.entity.Mail_evaluate_etl; +import com.biutag.outeradmin.mapper.Mail_EtlMapper; +import com.biutag.outeradmin.mapper.Mail_Eva_EtlMapper; +import org.springframework.stereotype.Service; + +@Service +public class MailEvaEtlService extends ServiceImpl { +}