zelong.shao

customer|add|校验规则调整

Showing 23 changed files with 198 additions and 126 deletions
......@@ -28,7 +28,7 @@ public enum ResponseCode {
MESSAGE_CODE_30008(30008,"business_exception_30008"),
MESSAGE_CODE_30009(30009,"business_exception_30009"),
MESSAGE_CODE_30010(30010,"business_exception_30010"),
MESSAGE_CODE_30011(30011,"business_exception_30010"),
MESSAGE_CODE_30011(30011,"business_exception_30011"),
MESSAGE_CODE_30012(30012,"business_exception_30012"),
/******打个样,编写样例*****/
......
......@@ -2,12 +2,13 @@ package com.fedex.connect.customer.repository.dao;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDate;
import java.util.List;
@Mapper
......@@ -19,10 +20,10 @@ public interface ConsignmentExtMapper {
@Select("SELECT * FROM ( " +
"SELECT t.* FROM T_BIZ_CONSIGNMENT t " +
"WHERE t.CONSIGNMENT_CODE = #{consignmentCode} " +
"AND t.CREATE_TIME >= SYSDATE - 30 " +
"AND t.CREATE_TIME >= #{dateParam} " +
"ORDER BY t.CREATE_TIME DESC" +
") WHERE ROWNUM = 1")
Consignment findByConsignmentCode(@Param("consignmentCode") String consignmentCode);
Consignment findByConsignmentCode(@Param("consignmentCode") String consignmentCode, @Param("dateParam") LocalDate dateParam);
@Select("SELECT BC.* FROM T_BIZ_CONSIGNMENT BC INNER JOIN T_BIZ_USER_CONSIGNMENT_MAPPING BUCM ON(BC.ID = BUCM.CONSIGNMENT_ID) " +
"WHERE BC.ID = #{query.consignmentId} AND (BC.USER_UUID = #{query.userUuid} AND BUCM.USER_ID = #{query.userId})")
......
......@@ -3,9 +3,10 @@ package com.fedex.connect.customer.repository.repo;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import java.time.LocalDate;
import java.util.List;
public interface IConsignmentRepository {
......@@ -13,7 +14,7 @@ public interface IConsignmentRepository {
Long findAllCount(ConsignmentQuery query);
Consignment findByConsignmentCode(String consignmentCode);
Consignment findByConsignmentCode(String consignmentCode,LocalDate dateParam);
Consignment findConsignmentInfo(UserConsignmentInfoQuery consignmentInfoQuery);
}
......
package com.fedex.connect.customer.repository.repo.impl;
import com.fedex.connect.common.dependencies.contants.SystemDefaultUserConstants;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
......@@ -7,9 +8,9 @@ import com.fedex.connect.customer.data.query.ConsignmentQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.repository.base.BaseDao;
import com.fedex.connect.customer.repository.repo.IConsignmentRepository;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
......@@ -31,7 +32,7 @@ public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRe
return Collections.emptyList();
}
consignments.forEach(consignment -> {
if (StringUtils.isBlank(consignment.getCreateUserName())) {
if (SystemDefaultUserConstants.SYSTEM_USER_KEYS.USER_NAME.equals(consignment.getCreateUserName())){
consignment.setCreateUserName(user.getUserName());
}
});
......@@ -44,8 +45,8 @@ public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRe
}
@Override
public Consignment findByConsignmentCode(String consignmentCode) {
return consignmentExtMapper.findByConsignmentCode(consignmentCode);
public Consignment findByConsignmentCode(String consignmentCode, LocalDate dateParam) {
return consignmentExtMapper.findByConsignmentCode(consignmentCode,dateParam);
}
public Consignment findConsignmentInfo(UserConsignmentInfoQuery userConsignmentInfoQuery){
......
......@@ -11,14 +11,13 @@ import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IAttachmentService;
import com.fedex.connect.customer.service.biz.IConsignmentService;
import com.fedex.connect.customer.util.service.biz.ConsignmentUtil;
import net.bytebuddy.asm.Advice;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDate;
import java.util.List;
import java.util.Objects;
/**
......@@ -44,7 +43,8 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
*/
public ResponseVo add(AddBo bo, User user){
//查询运单表是否存在已提交的运单
Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode());
LocalDate thirtyDaysAgo = LocalDate.now().minusDays(30);
Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode(),thirtyDaysAgo);
/**
* 不存在则直接返回
*/
......
......@@ -70,14 +70,6 @@ public class ConsignmentUtil {
}
/**
* uuid不一致且未填写shipperAccount
*/
if (StringUtils.hasText(bo.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30012);
}
/**
* 运单的shipperAccount和用户的shipperAccount一致,则返回提示语+运单信息
*/
if (isShipperAccountMatch(user.getAccountNo(), consignment.getShipperAccount())) {
......@@ -86,11 +78,29 @@ public class ConsignmentUtil {
}
/**
* uuid不一致且未填写shipperAccount
*/
if (!StringUtils.hasText(bo.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30012);
}
/**
* 录入的shipperAccount和运单的shipperAccount一致,则返回提示语+运单信息
*/
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30005, consignmentAddDto);
return responseUtils.success(consignmentAddDto);
}
// 如果存在DM501,但是一个用户没有使用这条DM501并且提交了这个运单号,另一个用户再次提交这个运单号的时候,则判断录入的shipperAccount和运单中用户手动输入的shipperAccount,如果一致,则返回;如果不一致,则提示重单
if (!StringUtils.isEmpty(consignment.getUserInputShipperAccount())){
if (isShipperAccountMatch(bo.getShipperAccount(),consignment.getUserInputShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
return responseUtils.success(consignmentAddDto);
}else {
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011);
}
}
/**
......
......@@ -41,6 +41,8 @@ public interface BaseConstants {
String USER_INPUT_ORIGIN_COUNTRY_CODE = "userInputOriginCountryCode";
//用户录入原产国全称
String USER_INPUT_ORIGIN_COUNTRY = "userInputOriginCountry";
//口岸
String DEST_IATA_CODE = "destTataCode";
}
//异常枚举字段
......
package com.fedex.connect.common.dependencies.template.clearanceEmail;
import org.springframework.stereotype.Component;
import java.text.MessageFormat;
@Component
public class ClearanceEmailTemplate implements EmailTemplate {
/**
* 模板标题格式化返回内容
*/
@Override
public String getTitle(Object ... arguments) {
return MessageFormat.format(CE_EMAIL_TITLE.TITLE,arguments);
}
/**
* 模板内容
*/
@Override
public String getBody(Object ... arguments) {
return CE_EMAIL_BODY.BODY;
}
}
package com.fedex.connect.common.dependencies.template.clearanceEmail;
public interface EmailTemplate {
String getTitle(Object ... arguments);
String getBody(Object ... arguments);
}
......@@ -2,10 +2,7 @@ package com.fedex.connect.task.repository.base;
import com.fedex.connect.common.dao.sys.KafkaStorageHistoryMapper;
import com.fedex.connect.common.dao.sys.KafkaTemporaryStorageMapper;
import com.fedex.connect.task.repository.dao.AttachmentExtMapper;
import com.fedex.connect.task.repository.dao.EmailExtMapper;
import com.fedex.connect.task.repository.dao.KafkaTemporaryStorageMapperExt;
import com.fedex.connect.task.repository.dao.RedisSlabMapperExt;
import com.fedex.connect.task.repository.dao.*;
import org.springframework.beans.factory.annotation.Autowired;
public class AbstractDaoRepository {
......@@ -21,4 +18,6 @@ public class AbstractDaoRepository {
protected EmailExtMapper emailExtMapper;
@Autowired
protected AttachmentExtMapper attachmentExtMapper;
@Autowired
protected PortclearEmailMappingExtMapper portclearEmailMappingExtMapper;
}
\ No newline at end of file
......
......@@ -8,12 +8,10 @@ import java.util.List;
@Mapper
public interface AttachmentExtMapper {
@Select("SELECT c.DEST_IATA_CODE, a.FILE_PATH " +
"FROM T_BIZ_EMAIL e " +
"JOIN T_BIZ_CONSIGNMENT c ON e.BIZ_ID = c.ID " +
"JOIN T_BIZ_ATTACHMENT a ON a.BIZ_ID = c.ID " +
"WHERE a.STATUS = 1 " +
"AND e.TYPE_CODE = #{typeCode} " +
"AND e.STATUS_CODE = #{statusCode}")
List<PushZipEmailDto> findPathWithPortCode(@Param("typeCode") String typeCode, @Param("statusCode") String statusCode);
@Select("SELECT a.FILE_PATH, c.DEST_IATA_CODE, c.CONSIGNMENT_CODE " +
"FROM T_BIZ_ATTACHMENT a " +
"JOIN T_BIZ_CONSIGNMENT c ON a.BIZ_ID = c.ID " +
"WHERE a.BIZ_ID = #{bizId}")
List<PushZipEmailDto> findAttachmentDetailsByBizId(@Param("bizId") Long bizId);
}
......
......@@ -7,5 +7,5 @@ import java.util.List;
@Mapper
public interface EmailExtMapper {
List<Email> findConPushEmails(Long typeId,Long statusId);
List<Email> findConPushEmails(String typeCode,String statusCode);
}
......
package com.fedex.connect.task.repository.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface PortclearEmailMappingExtMapper {
@Select("SELECT EMAIL FROM T_BI_PORTCLEAR_EMAIL_MAPPING WHERE PORT_CODE = #{portCode}")
String findEmailByPortCode(@Param("portCode") String portCode);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fedex.connect.task.repository.dao.EmailExtMapper">
<select id="findConPushEmails" resultType="com.fedex.connect.common.model.biz.Email">
<select id="findConPushEmails" resultType="com.fedex.connect.common.model.biz.Email">
SELECT *
FROM (
SELECT *
FROM T_BIZ_EMAIL
WHERE TYPE_ID = #{typeId}
AND STATUS_ID = #{statusId}
WHERE TYPE_CODE = #{typeCode}
AND STATUS_CODE = #{statusCode}
ORDER BY CREATED_DATE DESC
)
WHERE ROWNUM &lt; 500
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fedex.connect.task.repository.dao.PortclearEmailMappingExtMapper">
</mapper>
\ No newline at end of file
package com.fedex.connect.task.repository.repo.bi;
import org.apache.ibatis.annotations.Param;
public interface IPortclearEmailMappingExtRepository {
String findEmailByPortCode(@Param("portCode") String portCode);
}
package com.fedex.connect.task.repository.repo.bi.impl;
import com.fedex.connect.task.repository.base.AbstractDaoRepository;
import com.fedex.connect.task.repository.repo.bi.IPortclearEmailMappingExtRepository;
import org.springframework.stereotype.Repository;
@Repository
public class PortclearEmailMappingExtRepositoryImpl extends AbstractDaoRepository implements IPortclearEmailMappingExtRepository {
@Override
public String findEmailByPortCode(String portCode) {
return portclearEmailMappingExtMapper.findEmailByPortCode(portCode);
}
}
package com.fedex.connect.task.repository.repo.biz;
import com.fedex.connect.task.data.dto.PushZipEmailDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface IAttachmentExtRepository {
List<PushZipEmailDto> findPathWithPortCode(String typeCode,String statusCode);
List<PushZipEmailDto> findAttachmentDetailsByBizId(@Param("bizId") Long bizId);
}
......
......@@ -5,5 +5,5 @@ import com.fedex.connect.common.model.biz.Email;
import java.util.List;
public interface IEmailExtRepository {
List<Email> findConPushEmails(Long typeId, Long statusId);
List<Email> findConPushEmails(String typeCode,String statusCode);
}
......
......@@ -11,7 +11,7 @@ import java.util.List;
public class AttachmentExtRepositoryImpl extends AbstractDaoRepository implements IAttachmentExtRepository {
@Override
public List<PushZipEmailDto> findPathWithPortCode(String typeCode, String statusCode) {
return attachmentExtMapper.findPathWithPortCode(typeCode,statusCode);
public List<PushZipEmailDto> findAttachmentDetailsByBizId(Long bizId) {
return attachmentExtMapper.findAttachmentDetailsByBizId(bizId);
}
}
......
......@@ -9,8 +9,8 @@ import java.util.List;
@Repository
public class EmailExtRepositoryImpl extends AbstractDaoRepository implements IEmailExtRepository {
public List<Email> findConPushEmails(Long typeId,Long statusId){
return emailExtMapper.findConPushEmails(typeId,statusId);
public List<Email> findConPushEmails(String typeCode,String statusCode){
return emailExtMapper.findConPushEmails(typeCode,statusCode);
}
}
......
......@@ -13,12 +13,8 @@ import com.fedex.connect.task.utils.sys.ConFileEmailUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author Szl
......@@ -47,27 +43,22 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush
*/
@Override
public void pushConsignmentFileTask(){
List<Email> emails = new ArrayList<>();
String tempPath = "";
String finalPath = "";
//查询需要发送的数据
List<PushZipEmailDto> pathWithPortCode = attachmentExtRepository.findPathWithPortCode(cacheSystem.getDicEmailType(EmailTypeEnum.PENDING.getEnMsg()).getCode(),
List<Email> conPushEmails = iEmailExtRepository.findConPushEmails(cacheSystem.getDicEmailType(EmailTypeEnum.PENDING.getEnMsg()).getCode(),
cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getEnMsg()).getCode());
if (CollectionUtils.isEmpty(pathWithPortCode)){
return;
}
//根据口岸分类构成map(口岸,filePaths)
Map<String, List<PushZipEmailDto>> portAttachmentsMap = new HashMap<>();
portAttachmentsMap = conFileEmailUtil.getPortAttachmentsMap(portAttachmentsMap,pathWithPortCode);
for (Email conPushEmail : conPushEmails) {
//获取待发送的文件并打zip包
List<PushZipEmailDto> attachmentDetailsByBizId = attachmentExtRepository.findAttachmentDetailsByBizId(conPushEmail.getBizId());
PortFileDto portFileDto = new PortFileDto();
portFileDto = conFileEmailUtil.getPortZipMap(portFileDto, attachmentDetailsByBizId, tempPath, finalPath, zipUtils);
//记录到发送邮件表中
//根据口岸构成zipPath的map(口岸,zip path)
List<PortFileDto> portFileDtoList = new ArrayList<>();
portFileDtoList = conFileEmailUtil.getPortZipMap(portFileDtoList, portAttachmentsMap, tempPath, finalPath, zipUtils);
//发送邮件
for (PortFileDto portFileDto : portFileDtoList) {
Email email = new Email();
}
}
}
......
......@@ -2,11 +2,16 @@ package com.fedex.connect.task.utils.sys;
import com.fedex.connect.common.dependencies.contants.BaseConstants;
import com.fedex.connect.common.dependencies.contants.BaseSeparatorConstants;
import com.fedex.connect.common.dependencies.enums.biz.AttachmentBizTypeEnum;
import com.fedex.connect.common.dependencies.util.DateUtil;
import com.fedex.connect.common.dependencies.util.ZipUtils;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.task.data.dto.PortFileDto;
import com.fedex.connect.task.data.dto.PushZipEmailDto;
import com.fedex.connect.task.repository.repo.bi.IPortclearEmailMappingExtRepository;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
......@@ -15,7 +20,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Author Szl
......@@ -26,87 +30,81 @@ import java.util.Map;
@Component
public class ConFileEmailUtil {
/**
* @Author Szl
* @Description 功能说明 构建map(口岸,文件目录)
* @Date 2024/11/14
* @param portAttachmentsMap
* @param pathWithPortCode
* @return java.util.Map<java.lang.String,java.util.List<com.fedex.connect.task.data.dto.PushZipEmailDto>>
*/
public Map<String, List<PushZipEmailDto>> getPortAttachmentsMap(Map<String, List<PushZipEmailDto>> portAttachmentsMap,List<PushZipEmailDto> pathWithPortCode){
for (PushZipEmailDto dto : pathWithPortCode) {
String destIataCode = dto.getDestIataCode();
if (destIataCode == null || destIataCode.isEmpty()) {
destIataCode = "null"; // 使用 "null" 代替空口岸
}
portAttachmentsMap.computeIfAbsent(destIataCode, k -> new ArrayList<>()).add(dto);
}
return portAttachmentsMap;
}
@Autowired
private IPortclearEmailMappingExtRepository portclearEmailMappingExtRepository;
/**
* @Author Szl
* @Description 功能说明 根据口岸打包,每个口岸的文件打成一个zip包
* @Date 2024/11/14
* @param portFileDtoList
* @param portAttachmentsMap
* @param tempPath
* @param finalPath
* @param zipUtils
* @return void
*/
public List<PortFileDto> getPortZipMap(List<PortFileDto> portFileDtoList, Map<String, List<PushZipEmailDto>> portAttachmentsMap, String tempPath, String finalPath, ZipUtils zipUtils){
for (Map.Entry<String, List<PushZipEmailDto>> entry : portAttachmentsMap.entrySet()) {
List<File> filesList = new ArrayList<>();
String portCode = entry.getKey();
List<PushZipEmailDto> portAttachments = entry.getValue();
// 打zip包
String date = DateUtil.formatTimeWithoutSlash(new Date());
String fileName = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP;
String fileNameTemp = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP + BaseConstants.FILE_SUFFIX_KEYS.TEMP;
FileOutputStream fos = null;
for (PushZipEmailDto portAttachment : portAttachments) {
File file = new File(portAttachment.getFilePath());
if (file.exists()) {
filesList.add(file);
}
public PortFileDto getPortZipMap(PortFileDto portFileDto, List<PushZipEmailDto> attachmentDetailsByBizId, String tempPath, String finalPath, ZipUtils zipUtils){
List<File> filesList = new ArrayList<>();
String portCode = null;
for (PushZipEmailDto pushZipEmailDto : attachmentDetailsByBizId) {
portCode = pushZipEmailDto.getDestIataCode();
if (pushZipEmailDto.getDestIataCode() == null || pushZipEmailDto.getDestIataCode().isEmpty()) {
portCode = BaseConstants.CONSIGNMENT_TABLE_COLUMN_KEYS.DEST_IATA_CODE; // 使用 "destTataCode" 代替空口岸
}
File file = new File(pushZipEmailDto.getFilePath());
if (file.exists()) {
filesList.add(file);
}
}
String date = DateUtil.formatTimeWithoutSlash(new Date());
String fileName = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP;
String fileNameTemp = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP + BaseConstants.FILE_SUFFIX_KEYS.TEMP;
FileOutputStream fos = null;
try {
fos = new FileOutputStream(tempPath + fileNameTemp);
zipUtils.toZip(filesList, fos);
try {
fos = new FileOutputStream(tempPath + fileNameTemp);
zipUtils.toZip(filesList, fos);
File file = new File(tempPath + fileNameTemp);
File finalFile = new File(finalPath + fileName);
File file = new File(tempPath + fileNameTemp);
File finalFile = new File(finalPath + fileName);
// 打包完成后重命名为正式文件
if (!file.renameTo(finalFile)) {
throw new IOException("无法重命名文件 " + file.getAbsolutePath() + " 到 " + finalFile.getAbsolutePath());
}
// 打包完成后重命名为正式文件
if (!file.renameTo(finalFile)) {
throw new IOException("无法重命名文件 " + file.getAbsolutePath() + " 到 " + finalFile.getAbsolutePath());
}
// 将结果添加到 portFileDtoList
PortFileDto portFileDto = new PortFileDto();
portFileDto.setDestIataCode(portCode);
portFileDto.setZipPath(finalPath + fileName);
portFileDtoList.add(portFileDto);
portFileDto.setDestIataCode(portCode);
portFileDto.setZipPath(finalPath + fileName);
} catch (Exception e) {
log.error("生成压缩包错误:{}", e.getMessage(), e);
} finally {
try {
if (fos != null) {
fos.close();
fos = null;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
} catch (Exception e) {
log.error("生成压缩包错误:{}", e.getMessage(), e);
} finally {
try {
if (fos != null) {
fos.close();
fos = null;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
return portFileDtoList;
return portFileDto;
}
public void saveEmail(Email conPushEmail,PortFileDto portFileDto){
//获取邮箱地址
if (BaseConstants.CONSIGNMENT_TABLE_COLUMN_KEYS.DEST_IATA_CODE.equals(portFileDto.getDestIataCode())){
portFileDto.setDestIataCode(AttachmentBizTypeEnum.OTH.getEnMsg());
}
String emailByPortCode = portclearEmailMappingExtRepository.findEmailByPortCode(portFileDto.getDestIataCode());
if (StringUtils.isEmpty(emailByPortCode)){
}
conPushEmail.setToAddress(emailByPortCode);
conPushEmail.setSubject();
conPushEmail.setBody();
conPushEmail.setFilePath(portFileDto.getZipPath());
}
}
......