Showing
4 changed files
with
27 additions
and
2 deletions
| ... | @@ -82,4 +82,10 @@ public class PropertiesConfig { | ... | @@ -82,4 +82,10 @@ public class PropertiesConfig { |
| 82 | 82 | ||
| 83 | @Value("${upload.path.zip}") | 83 | @Value("${upload.path.zip}") |
| 84 | private String zipPath; | 84 | private String zipPath; |
| 85 | + | ||
| 86 | + @Value("${upload.path.zipFinal}") | ||
| 87 | + private String zipFinalPath; | ||
| 88 | + | ||
| 89 | + @Value("${upload.path.zipTemp}") | ||
| 90 | + private String zipTempPath; | ||
| 85 | } | 91 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -7,6 +7,7 @@ import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; | ... | @@ -7,6 +7,7 @@ import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum; |
| 7 | import com.fedex.connect.common.dependencies.util.NIOFileUtils; | 7 | import com.fedex.connect.common.dependencies.util.NIOFileUtils; |
| 8 | import com.fedex.connect.common.dependencies.util.ZipUtils; | 8 | import com.fedex.connect.common.dependencies.util.ZipUtils; |
| 9 | import com.fedex.connect.common.model.biz.Email; | 9 | import com.fedex.connect.common.model.biz.Email; |
| 10 | +import com.fedex.connect.task.config.PropertiesConfig; | ||
| 10 | import com.fedex.connect.task.data.dto.MailConfigDto; | 11 | import com.fedex.connect.task.data.dto.MailConfigDto; |
| 11 | import com.fedex.connect.task.data.dto.PortFileDto; | 12 | import com.fedex.connect.task.data.dto.PortFileDto; |
| 12 | import com.fedex.connect.task.data.dto.PushZipEmailDto; | 13 | import com.fedex.connect.task.data.dto.PushZipEmailDto; |
| ... | @@ -18,6 +19,7 @@ import lombok.extern.slf4j.Slf4j; | ... | @@ -18,6 +19,7 @@ import lombok.extern.slf4j.Slf4j; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
| 20 | 21 | ||
| 22 | +import java.io.File; | ||
| 21 | import java.util.List; | 23 | import java.util.List; |
| 22 | 24 | ||
| 23 | /** | 25 | /** |
| ... | @@ -44,6 +46,9 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush | ... | @@ -44,6 +46,9 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush |
| 44 | @Autowired | 46 | @Autowired |
| 45 | private NIOFileUtils nioFileUtils; | 47 | private NIOFileUtils nioFileUtils; |
| 46 | 48 | ||
| 49 | + @Autowired | ||
| 50 | + private PropertiesConfig propertiesConfig; | ||
| 51 | + | ||
| 47 | /** | 52 | /** |
| 48 | * @Author Szl | 53 | * @Author Szl |
| 49 | * @Description 功能说明 推送清关文件 | 54 | * @Description 功能说明 推送清关文件 |
| ... | @@ -53,8 +58,18 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush | ... | @@ -53,8 +58,18 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush |
| 53 | */ | 58 | */ |
| 54 | @Override | 59 | @Override |
| 55 | public void pushConsignmentFileTask(){ | 60 | public void pushConsignmentFileTask(){ |
| 56 | - String tempPath = ""; | 61 | + String tempPath = propertiesConfig.getZipTempPath(); |
| 57 | - String finalPath = ""; | 62 | + String finalPath = propertiesConfig.getZipFinalPath(); |
| 63 | + // 检查并创建临时目录 | ||
| 64 | + File tempDir = new File(tempPath); | ||
| 65 | + if (!tempDir.exists()) { | ||
| 66 | + tempDir.mkdirs(); | ||
| 67 | + } | ||
| 68 | + // 检查并创建最终目录 | ||
| 69 | + File finalDir = new File(finalPath); | ||
| 70 | + if (!finalDir.exists()) { | ||
| 71 | + finalDir.mkdirs(); | ||
| 72 | + } | ||
| 58 | //查询需要发送的数据 | 73 | //查询需要发送的数据 |
| 59 | List<Email> conPushEmails = iEmailExtRepository.findEmailsByDic(cacheSystem.getDicEmailType(EmailTypeEnum.PUSH_CON_FILE.getCode()).getCode(), | 74 | List<Email> conPushEmails = iEmailExtRepository.findEmailsByDic(cacheSystem.getDicEmailType(EmailTypeEnum.PUSH_CON_FILE.getCode()).getCode(), |
| 60 | cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getCode()).getCode(),ParamConfigConstants.TASK_PARAM_KEYS.PUSH_CON_NUMBER); | 75 | cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getCode()).getCode(),ParamConfigConstants.TASK_PARAM_KEYS.PUSH_CON_NUMBER); | ... | ... |
| ... | @@ -57,3 +57,5 @@ imp001: | ... | @@ -57,3 +57,5 @@ imp001: |
| 57 | upload: | 57 | upload: |
| 58 | path: | 58 | path: |
| 59 | zip: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip | 59 | zip: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip |
| 60 | + zipTemp: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp | ||
| 61 | + zipFinal: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -53,3 +53,5 @@ imp001: | ... | @@ -53,3 +53,5 @@ imp001: |
| 53 | upload: | 53 | upload: |
| 54 | path: | 54 | path: |
| 55 | zip: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip | 55 | zip: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip |
| 56 | + zipTemp: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp | ||
| 57 | + zipFinal: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment