tao.mo

task-schedule | 修改 | 推送IMP001报文开发

mt
2024年11月21日16:13:02
Showing 26 changed files with 244 additions and 129 deletions
......@@ -17,5 +17,5 @@ public interface AttachmentExtMapper {
@Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = " +
"(SELECT MAX(ID) FROM T_BIZ_UPLOAD_RECORD WHERE CREATE_USER_ID = #{query.userId} " +
"AND CONSIGNMENT_ID = #{query.consignmentId}) AND STATUS = 1")
Attachment queryInfo(@Param("query") UserConsignmentInfoQuery query);
List<Attachment> queryInfo(@Param("query") UserConsignmentInfoQuery query);
}
\ No newline at end of file
......
......@@ -10,7 +10,7 @@ import java.util.List;
public interface IAttachmentRepository {
List<AttachmentHistoryDto> findHistory(AttachmentHistoryQuery attachmentHistoryQuery);
Attachment queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery);
List<Attachment> queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery);
Attachment saveOrUpdate(Attachment entity);
......
......@@ -26,7 +26,7 @@ public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepo
* @return com.fedex.connect.common.model.biz.Attachment
*/
@Override
public Attachment queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery){
public List<Attachment> queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery){
return attachmentExtMapper.queryInfo(userConsignmentInfoQuery);
}
......
......@@ -7,6 +7,8 @@ import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IAttachmentQueryService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author Szl
* @Description 类说明 附件查询相关service
......@@ -23,7 +25,7 @@ public class AttachmentQueryServiceImpl extends BaseService implements IAttachme
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public ResponseVo queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery){
Attachment attachment = attachmentRepository.queryInfo(userConsignmentInfoQuery);
return responseUtils.success(attachment);
List<Attachment> attachmentList = attachmentRepository.queryInfo(userConsignmentInfoQuery);
return responseUtils.success(attachmentList);
}
}
\ No newline at end of file
......
......@@ -21,8 +21,12 @@ public interface ParamConfigConstants {
* @Date 2024/11/20
*/
interface TASK_PARAM_KEYS{
//推送TW001间隔配置key
//推送IMP001任务间隔
String PUSH_IMP001_INTERVAL = "push_imp001_interval";
//推送IMP001定时任务处理数量
String PUSH_IMP001_NUMBER = "push_imp001_number";
//推送IMP001重试处理数量
String PUSH_IMP001_RETRY_NUMBER = "push_imp001_retry_number";
//推送进口文件定时任务处理数量
String PUSH_CON_NUMBER = "push_con_number";
//通知发件人定时任务处理数量
......
package com.fedex.connect.task.constants;
/**
* @Author mt
* @Description 类说明 常量接口
* @Date 2024/4/18
*/
public interface Constant {
//TW001表头信息
interface IMP001_HEAD_KEYS{
/**
* 消息代码:IMP001报文标志
*/
String MESSAGE_CODE = "IMP001";
/**
* 发送程序ID:TWEXP
*/
String SENDER_ID = "TWEXP";
/**
* 接受程序ID:IMP
*/
String RECEIVER_ID = "IMP";
}
//文件后缀字符串keys
interface FILE_SUFFIX_KEYS{
/**
* json字符串
*/
String JSON = ".json";
/**
* temp临时文件
*/
String TEMP = ".temp";
/**
* zip文件后缀
*/
String ZIP = ".zip";
}
}
\ No newline at end of file
package com.fedex.connect.task.data.dto.imp001;
import com.fedex.connect.common.dependencies.arithmetic.AESUtil;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
......@@ -25,65 +23,5 @@ public class Imp001Consignment implements Serializable {
* @Description 联络人
* @Date 2024/5/23
*/
private String liaisons;
/**
* @Author mt
* @Description 货物输出统一编号
* 8-12位,数字加英文大写
* @Date 2024/5/23
*/
private String consigneeNo;
/**
* @Author mt
* @Description 联络人email
* 标准邮件格式:xxx@xx.com
* @Date 2024/5/23
*/
private String email;
/**
* @Author mt
* @Description 联络电话
* 包含:数字、空格-()()#::,,;;+.
* @Date 2024/5/23
*/
private String tel;
/**
* @Author mt
* @Description 分机
* 包含:数字、空格-()()#::,,;;+.
* @Date 2024/5/23
*/
private String extensionTel;
/**
* @Author mt
* @Description 行动电话
* 包含:数字、空格-()()#::,,;;+.
* @Date 2024/5/23
*/
private String phone;
/**
* @Author mt
* @Description 特殊交代事项
* @Date 2024/5/23
*/
private String customsClearanceInstruction;
/**
* @Author mt
* @Description 对部分字段进行解密
* @Date 2024/6/13
* @param
* @return void
*/
public void decode() {
if (StringUtils.isNotBlank(this.getLiaisons())){
this.setLiaisons(AESUtil.decode_default(this.getLiaisons()));
}
if (StringUtils.isNotBlank(this.getTel())){
this.setTel(AESUtil.decode_default(this.getTel()));
}
if (StringUtils.isNotBlank(this.getPhone())){
this.setPhone(AESUtil.decode_default(this.getPhone()));
}
}
private Integer attachedFilesCount;
}
\ No newline at end of file
......
......@@ -20,20 +20,19 @@ public class Imp001Files implements Serializable {
private String name;
/**
* @Author mt
* @Description 文件来源
* "文件类型
* (1:系统生成的的“聯絡方式與特殊交待事項”。2:系统生成的“出口報關檢核表”。3:用户上传的文件)"
* @Date 2024/5/23
*/
private Integer source;
/**
* @Author mt
* @Description 文件名后缀
* 小写
* @Date 2024/5/23
*/
private String suffix;
/**
* @Author mt
* @Description 分运单,发票,箱单和其它这四种类型 AWB,INV,PKL,OTH
* 大写
* @Date 2024/5/23
*/
private String contentType;
/**
* @Author mt
* @Description 文件大小
* 字节数
......
......@@ -7,7 +7,7 @@ import java.io.Serializable;
/**
* @Author mt
* @Description tw001消息主体
* @Description imp001消息主体
* @Date 2024/5/23
*/
@Data
......
package com.fedex.connect.task.repository.base;
import com.fedex.connect.common.dao.biz.ConsignmentMapper;
import com.fedex.connect.common.dao.biz.EmailMapper;
import com.fedex.connect.common.dao.biz.PushObMapper;
import com.fedex.connect.common.dao.log.EmailHistoryMapper;
......@@ -34,4 +35,6 @@ public class AbstractDaoRepository {
protected PushObMapperExt pushObMapperExt;
@Autowired
protected ParamConfigMapper paramConfigMapper;
@Autowired
protected ConsignmentMapper consignmentMapper;
}
\ No newline at end of file
......
package com.fedex.connect.task.repository.dao;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.task.data.dto.PushZipEmailDto;
import org.apache.ibatis.annotations.*;
......@@ -14,4 +15,8 @@ public interface AttachmentExtMapper {
"WHERE a.BIZ_ID = #{bizId}")
List<PushZipEmailDto> findAttachmentDetailsByBizId(@Param("bizId") Long bizId);
@Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = " +
"(SELECT MAX(ID) FROM T_BIZ_UPLOAD_RECORD WHERE " +
" CONSIGNMENT_ID = #{consignmentId}) AND STATUS = 1")
List<Attachment> queryAttachmentInfo(@Param("consignmentId") Long consignmentId);
}
......
......@@ -11,18 +11,18 @@ import java.util.List;
public interface PushObMapperExt {
@Select( "<script>" +
"SELECT * FROM T_PUSH_OB_LOG WHERE STATUS_CODE = #{statusCode,jdbcType=VARCHAR} AND ROWNUM &lt;= 500" +
"SELECT * FROM T_BIZ_PUSH_OB WHERE STATUS_CODE = #{statusCode,jdbcType=VARCHAR} AND ROWNUM &lt;= #{rownum,jdbcType=NUMERIC}" +
"</script>")
List<PushOb> findPushObByStatus(@Param("statusCode") String statusCode);
List<PushOb> findPushObByStatus(@Param("statusCode") String statusCode,@Param("rownum") Long rownum);
@Select( "<script>" +
"SELECT * FROM T_PUSH_OB_LOG WHERE PUSH_NUM &lt; #{pushNum,jdbcType=NUMERIC} AND STATUS_CODE = #{statusCode,jdbcType=VARCHAR} AND ROWNUM &lt;= 500" +
"SELECT * FROM T_BIZ_PUSH_OB WHERE PUSH_NUM &lt; #{pushNum,jdbcType=NUMERIC} AND STATUS_CODE = #{statusCode,jdbcType=VARCHAR} AND ROWNUM &lt;= #{rownum,jdbcType=NUMERIC}" +
"</script>")
List<PushOb> findPushObByStatusAndNum(@Param("pushNum") Long pushNum, @Param("statusCode") String statusCode);
List<PushOb> findPushObByStatusAndNum(@Param("pushNum") Long pushNum, @Param("statusCode") String statusCode,@Param("rownum") Long rownum);
@Select( "<script>" +
"SELECT count(*) FROM T_PUSH_OB_LOG WHERE PUSH_NUM &gt;= #{pushNum,jdbcType=NUMERIC} AND PUSH_STATUS = #{statusCode,jdbcType=VARCHAR} " +
"SELECT count(*) FROM T_BIZ_PUSH_OB WHERE PUSH_NUM &gt;= #{pushNum,jdbcType=NUMERIC} AND PUSH_STATUS = #{statusCode,jdbcType=VARCHAR} " +
"AND TRUNC(CREATE_TIME) = TRUNC(TO_DATE(#{date,jdbcType=VARCHAR}, 'YYYY-MM-DD'))" +
"</script>")
Integer findErrPushForEmail(@Param("pushNum") Long pushNum, @Param("statusCode") String statusCode, @Param("date") String date);
}
}
\ No newline at end of file
......
package com.fedex.connect.task.repository.repo.biz;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.task.data.dto.PushZipEmailDto;
import org.apache.ibatis.annotations.Param;
......@@ -8,4 +9,6 @@ import java.util.List;
public interface IAttachmentRepository {
List<PushZipEmailDto> findAttachmentDetailsByBizId(@Param("bizId") Long bizId);
List<Attachment> queryAttachmentInfo(Long consignmentId);
}
......
package com.fedex.connect.task.repository.repo.biz;
import com.fedex.connect.common.model.biz.Consignment;
public interface IConsignmentRepository {
Consignment findById(Long id);
}
......@@ -28,9 +28,10 @@ public interface IPushObRepository {
* @Description 根据推送次数,推送状态查找需要推送记录
* @Date 2024/11/20
* @param statusCode
* @param rownum
* @return java.util.List<com.fedex.connect.common.model.biz.PushOb>
*/
List<PushOb> findPushOb(String statusCode);
List<PushOb> findPushOb(String statusCode,Long rownum);
/**
* @Author mt
......@@ -38,9 +39,10 @@ public interface IPushObRepository {
* @Date 2024/11/20
* @param pushNum
* @param statusCode
* @param rownum
* @return java.util.List<com.fedex.connect.common.model.biz.PushOb>
*/
List<PushOb> findErrPushOb(Long pushNum,String statusCode);
List<PushOb> findErrPushOb(Long pushNum,String statusCode,Long rownum);
Integer findErrPushForEmail(Long pushNum,String statusCode,String date);
}
......
package com.fedex.connect.task.repository.repo.biz.impl;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.task.data.dto.PushZipEmailDto;
import com.fedex.connect.task.repository.base.AbstractDaoRepository;
import com.fedex.connect.task.repository.repo.biz.IAttachmentRepository;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -14,4 +16,9 @@ public class AttachmentRepositoryImpl extends AbstractDaoRepository implements I
public List<PushZipEmailDto> findAttachmentDetailsByBizId(Long bizId) {
return attachmentExtMapper.findAttachmentDetailsByBizId(bizId);
}
@Override
public List<Attachment> queryAttachmentInfo(Long consignmentId){
return attachmentExtMapper.queryAttachmentInfo(consignmentId);
}
}
......
package com.fedex.connect.task.repository.repo.biz.impl;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.task.repository.base.AbstractDaoRepository;
import com.fedex.connect.task.repository.repo.biz.IConsignmentRepository;
import org.springframework.stereotype.Repository;
@Repository
public class ConsignmentRepositoryImpl extends AbstractDaoRepository implements IConsignmentRepository {
/**
* @Author mt
* @Description 根据运单ID查找运单信息
* @Date 2024/11/18
* @param id
* @return com.fedex.connect.common.model.biz.Consignment
*/
public Consignment findById(Long id){
return consignmentMapper.selectByPrimaryKey(id);
}
}
......@@ -41,8 +41,8 @@ public class PushObRepositoryImpl extends AbstractDaoRepository implements IPush
* @return java.util.List<com.fedex.connect.common.model.biz.PushOb>
*/
@Override
public List<PushOb> findPushOb(String statusCode) {
return pushObMapperExt.findPushObByStatus(statusCode);
public List<PushOb> findPushOb(String statusCode,Long rownum) {
return pushObMapperExt.findPushObByStatus(statusCode,rownum);
}
/**
......@@ -54,8 +54,8 @@ public class PushObRepositoryImpl extends AbstractDaoRepository implements IPush
* @return java.util.List<com.fedex.connect.common.model.biz.PushOb>
*/
@Override
public List<PushOb> findErrPushOb(Long pushNum, String statusCode) {
return pushObMapperExt.findPushObByStatusAndNum(pushNum,statusCode);
public List<PushOb> findErrPushOb(Long pushNum, String statusCode,Long rownum) {
return pushObMapperExt.findPushObByStatusAndNum(pushNum,statusCode,rownum);
}
@Override
......
......@@ -2,6 +2,9 @@ package com.fedex.connect.task.repository.repo.sys;
import com.fedex.connect.common.model.sys.ParamConfig;
import java.util.Map;
public interface IParamConfigRepository {
ParamConfig findValueByCode(String code);
Map<String,ParamConfig> findValueByCodes(String...strings);
}
......
......@@ -8,6 +8,12 @@ import com.fedex.connect.task.repository.repo.sys.IParamConfigRepository;
import org.springframework.stereotype.Repository;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Repository
public class ParamConfigRepositoryImpl extends AbstractDaoRepository implements IParamConfigRepository {
......@@ -19,4 +25,19 @@ public class ParamConfigRepositoryImpl extends AbstractDaoRepository implements
criteria.andStatusEqualTo(StatusEnum.YES.getCode());
return CollectionUtils.firstElement(paramConfigMapper.selectByExample(example));
}
@Override
public Map<String,ParamConfig> findValueByCodes(String...strings) {
if(Objects.isNull(strings) || strings.length == 0){
return null;
}
List<String> codes = Arrays.asList(strings);
ParamConfigExample example = new ParamConfigExample();
ParamConfigExample.Criteria criteria = example.createCriteria();
criteria.andCodeIn(codes);
criteria.andStatusEqualTo(StatusEnum.YES.getCode());
List<ParamConfig> paramConfigList = paramConfigMapper.selectByExample(example);
Map<String,ParamConfig> paramConfigMap = paramConfigList.stream().filter(Objects::nonNull).collect(Collectors.toMap(ParamConfig::getCode, paramConfig -> paramConfig));
return paramConfigMap;
}
}
\ No newline at end of file
......
......@@ -6,6 +6,7 @@ import com.fedex.connect.task.repository.repo.biz.IEmailRepository;
import com.fedex.connect.task.repository.repo.biz.IPushObRepository;
import com.fedex.connect.task.repository.repo.sys.IKafkaStorageHistoryRepository;
import com.fedex.connect.task.repository.repo.sys.IKafkaTemporaryStorageRepository;
import com.fedex.connect.task.repository.repo.sys.IParamConfigRepository;
import com.fedex.connect.task.repository.repo.sys.IRedisSlabExtRepository;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,4 +30,6 @@ public class BaseService {
protected IAttachmentRepository attachmentExtRepository;
@Autowired
protected IPushObRepository pushObRepository;
@Autowired
protected IParamConfigRepository paramConfigRepository;
}
\ No newline at end of file
......
package com.fedex.connect.task.service.biz;
import com.fedex.connect.common.model.biz.Consignment;
public interface IPushObService {
/**
* @Author mt
* @Description 保存pushLog表记录
* @Date 2024/8/2
* @param consignment
* @return void
*/
void savePushLog(Consignment consignment);
/**
* @Author mt
* @Description 推送Imp001报文数据zip包文件
* @Date 2024/8/2
* @param
......
package com.fedex.connect.task.service.biz.impl;
import com.fedex.connect.common.dependencies.contants.ParamConfigConstants;
import com.fedex.connect.common.dependencies.enums.biz.PushObStatusEnum;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.biz.PushOb;
import com.fedex.connect.common.model.sys.ParamConfig;
import com.fedex.connect.task.data.bo.Imp001GenerateBo;
import com.fedex.connect.task.service.base.BaseService;
import com.fedex.connect.task.service.biz.IPushObService;
import com.fedex.connect.task.utils.biz.imp001.Imp001GenerateUtil;
import com.fedex.connect.task.utils.biz.imp001.Imp001PushUtil;
import com.fedex.connect.task.utils.biz.imp001.Imp001RecordLogUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @Author mt
......@@ -18,18 +27,25 @@ import java.util.List;
@Slf4j
@Service
public class PushObServiceImpl extends BaseService implements IPushObService {
public void savePushLog(Consignment consignment){
}
@Autowired
Imp001GenerateUtil imp001GenerateUtil;
@Autowired
Imp001PushUtil imp001PushUtil;
@Autowired
Imp001RecordLogUtil imp001RecordLogUtil;
/**
* 推送OB报文数据zip包文件
*/
@Override
public void sendOb() {
//获取每次处理数据量量参数
ParamConfig paramConfig = paramConfigRepository.findValueByCode(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER);
Long rownum = Long.parseLong(paramConfig.getValue());
//获取需要处理的记录
List<PushOb> pushObLogList = pushObRepository.findPushOb(PushObStatusEnum.TO_BE_SENT.getCode());
List<PushOb> pushObList = pushObRepository.findPushOb(PushObStatusEnum.TO_BE_SENT.getCode(),rownum);
//推送imp001数据
this.pushOb(pushObList);
}
/**
......@@ -37,7 +53,24 @@ public class PushObServiceImpl extends BaseService implements IPushObService {
*/
@Override
public void sendObRetry() {
//获取每次处理数据量量参数
Map<String,ParamConfig> paramConfig = paramConfigRepository.findValueByCodes(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER,
ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_RETRY_NUMBER);
//推送IMP001重试处理数量
ParamConfig retryNumConfig = paramConfig.get(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_RETRY_NUMBER);
Long retryNum = Long.parseLong(retryNumConfig.getCode());
//推送IMP001定时任务处理数量
ParamConfig rownumConfig = paramConfig.get(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER);
Long rownum = Long.parseLong(rownumConfig.getCode());
//获取需要重新处理的记录:处理4次以下,并且推送失败的
List<PushOb> errPushObLog = pushObRepository.findErrPushOb(retryNum, PushObStatusEnum.PUSH_FAILED.getCode(),rownum);
if (errPushObLog!=null && !errPushObLog.isEmpty()){
log.info("sendObRetryTask : sendObRetry size: "+errPushObLog.size());
//重新推送tw001数据
this.pushOb(errPushObLog);
}else{
log.info("sendObRetryTask : No data found for sendObRetry!");
}
}
/**
......@@ -48,6 +81,33 @@ public class PushObServiceImpl extends BaseService implements IPushObService {
* @return void
*/
private void pushOb(List<PushOb> pushObList){
Utils.listOf(pushObList).stream().filter(Objects::nonNull).forEach(ob ->{
boolean flag = false;
String errorMsg = "";
Imp001GenerateBo imp001GenerateBo = null;
try {
//生成tw001 json对象dto
imp001GenerateBo = imp001GenerateUtil.generateImp001Json(ob);
//根据tw001 json对象生成并且推送zip包
imp001PushUtil.pushImp001(imp001GenerateBo);
flag = true;
}catch(Exception ex){
log.error("pushOb error : ",ex);
errorMsg = ex.getMessage();
flag = false;
}finally{
/**
* 如果生成失败,推送失败,则不会记录推送日志明细,更新推送日志表。
* 记录日志,并且备份
*/
if(flag){
//推送成功
imp001RecordLogUtil.pushSuccessRecordLog(imp001GenerateBo, ob);
}else{
//推送失败
imp001RecordLogUtil.pushFailRecordLog(imp001GenerateBo, ob, errorMsg);
}
}
});
}
}
\ No newline at end of file
......
//package com.fedex.connect.task.utils.biz.imp001;
//
//import com.fedex.connect.task.config.PropertiesConfig;
//import com.fedex.connect.task.data.bo.Imp001GenerateBo;
//import com.fedex.export.common.util.*;
//import com.fedex.export.config.PropertiesConfig;
//import com.fedex.export.constants.Constant;
......@@ -7,6 +9,7 @@
//import com.fedex.export.data.bo.Imp001GenerateBo;
//import com.fedex.export.repository.entity.DeclareInfo;
//import com.fedex.export.repository.entity.SysDictionary;
//import lombok.extern.slf4j.Slf4j;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
......@@ -24,9 +27,9 @@
// * @Description tw001报文推送,util
// * @Date 2024/5/29
// */
//@Slf4j
//@Component
//public class Tw001PushUtil {
// private static Logger log = LoggerFactory.getLogger(Tw001PushUtil.class);
//public class Imp001PushUtil {
// @Autowired
// PropertiesConfig propertiesConfig;
// @Autowired
......@@ -36,17 +39,17 @@
//
// /**
// * @Author mt
// * @Description 推送tw001
// * @Date 2024/5/29
// * @param tw001GenerateBo
// * @return com.fedex.export.data.dto.tw001.Imp001RootJsonDto
// * @Description 推送imp001
// * @Date 2024/11/21
// * @param imp001GenerateBo
// * @return void
// */
// public void pushTw001(Imp001GenerateBo tw001GenerateBo) throws Exception{
// public void pushImp001(Imp001GenerateBo imp001GenerateBo) throws Exception{
// long start = System.currentTimeMillis();
// //生成zip临时文件到指定临时目录
// String zipFileName = this.toZips(tw001GenerateBo);
// String zipFileName = this.toZips(imp001GenerateBo);
// //zip原始临时目录,zip为临时文件
// String zipSourceTempFilePath = tw001GenerateBo.getWorkFilePath() + zipFileName + Constant.FILE_SUFFIX_KEYS.TEMP;
// String zipSourceTempFilePath = imp001GenerateBo.getWorkFilePath() + zipFileName + Constant.FILE_SUFFIX_KEYS.TEMP;
// //推送zip文件最终目录
// String zipTargetFilePath = propertiesConfig.getTw001PathFinal() + zipFileName;
// //记录zip文件名称
......
//package com.fedex.connect.task.utils.biz.imp001;
//
//import com.fedex.connect.common.model.biz.PushOb;
//import com.fedex.connect.task.config.PropertiesConfig;
//import com.fedex.connect.task.data.bo.Imp001GenerateBo;
//import com.fedex.export.common.enums.PushLogEnum;
//import com.fedex.export.common.util.DateUtil;
//import com.fedex.export.common.util.NioFileUtils;
......@@ -12,6 +15,7 @@
//import com.fedex.export.repository.entity.log.PushObLog;
//import com.fedex.export.repository.repo.business.IPushObLogRepository;
//import com.fedex.export.service.business.IPushObDetailService;
//import lombok.extern.slf4j.Slf4j;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
......@@ -27,9 +31,9 @@
// * @Description 类说明 推送tw001完成,记录日志,并且备份数据
// * @Date 2024/5/30
// */
//@Slf4j
//@Component
//public class Tw001RecordLogUtil {
// private static Logger log = LoggerFactory.getLogger(Tw001RecordLogUtil.class);
//public class Imp001RecordLogUtil {
// @Autowired
// PropertiesConfig propertiesConfig;
// @Autowired
......@@ -41,18 +45,19 @@
//
// /**
// * @Author mt
// * @Description 功能说明 推送成功记录日志
// * @Date 2024/5/30
// * @param tw001GenerateBo
// * @Description 推送成功记录日志
// * @Date 2024/11/21
// * @param imp001GenerateBo
// * @param obLog
// * @return void
// */
// public void pushSuccessRecordLog(Imp001GenerateBo tw001GenerateBo, PushObLog obLog){
// public void pushSuccessRecordLog(Imp001GenerateBo imp001GenerateBo, PushOb obLog){
// try {
// if(Objects.nonNull(tw001GenerateBo)){
// if(Objects.nonNull(imp001GenerateBo)){
// //备份文件,并且记录日志
// String targetPath = this.recordLog(tw001GenerateBo,obLog , propertiesConfig.getTw001PathBak(),PushLogEnum.PUSHED_SUCCESS,null);
// obLog.setFileName(tw001GenerateBo.getZipFileName());
// obLog.setFilePath(tw001GenerateBo.getZipFileTargetPath());
// String targetPath = this.recordLog(imp001GenerateBo,obLog , propertiesConfig.getTw001PathBak(),PushLogEnum.PUSHED_SUCCESS,null);
// obLog.setFileName(imp001GenerateBo.getZipFileName());
// obLog.setFilePath(imp001GenerateBo.getZipFileTargetPath());
// obLog.setFileBackPath(targetPath);
// }
// obLog.setPushNum(obLog.getPushNum() + 1);
......@@ -75,7 +80,7 @@
// * @param errorMsg
// * @return void
// */
// public void pushFailRecordLog(Imp001GenerateBo tw001GenerateBo, PushObLog obLog, String errorMsg){
// public void pushFailRecordLog(Imp001GenerateBo tw001GenerateBo, PushOb obLog, String errorMsg){
// try {
// if(Objects.nonNull(tw001GenerateBo)){
// //备份文件,并且记录失败日志
......@@ -105,7 +110,7 @@
// * @return 返回目标备份路径
// */
// private String recordLog(Imp001GenerateBo tw001GenerateBo,
// PushObLog obLog,
// PushOb obLog,
// String tarPath,
// PushLogEnum pushLogEnum,
// String remark){
......