优化日志功能集成

This commit is contained in:
liuy 2024-09-04 10:08:46 +08:00
parent b9498d3984
commit c4c7beff18
8 changed files with 90 additions and 12 deletions

View File

@ -426,6 +426,8 @@ public class ConsignmachiningIn extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setRootAppPk(consignmachiningInSonDto.getId()); integrationTaskLivingDetailsEntity.setRootAppPk(consignmachiningInSonDto.getId());
integrationTaskLivingDetailsEntity.setRootAppBill(consignmachiningInSonDto.getCode()); integrationTaskLivingDetailsEntity.setRootAppBill(consignmachiningInSonDto.getCode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
integrationTaskLivingDetailsEntity.setNewSystemNumber(vbillcode);//下游单据编码
integrationTaskLivingDetailsEntity.setNewSystemPrimary(cgeneralhid);//下游单据主键
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) { } catch (Exception e) {
logger.error("推送U8C委外订单失败", e); logger.error("推送U8C委外订单失败", e);

View File

@ -386,7 +386,8 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
Map<String, List<ConsignmachiningInHeadBodyDto>> stringStringMap = new HashMap<>(); Map<String, List<ConsignmachiningInHeadBodyDto>> stringStringMap = new HashMap<>();
stringStringMap.put("GeneralBillVO", consignmachiningInHeadBodyDtoArrayList); stringStringMap.put("GeneralBillVO", consignmachiningInHeadBodyDtoArrayList);
//2024年8月26日 14:41:46 委外入库核销方式传不了已经提交总部2024年8月30日 14:05:25 已经解决和妮姐确认不用填写 //2024年8月26日 14:41:46 委外入库核销方式传不了已经提交总部2024年8月30日 14:05:25 已经解决和妮姐确认不用填写
//TODO 2024年8月26日 14:42:19 无法超委外订单数量入库已经提交给总部 //2024年8月26日 14:42:19 无法超委外订单数量入库已经提交给总部
//2024年9月3日 18:28:24 退货不会出现超订单出库的情况
IcGeneralHResultDto icGeneralHResultDto = sendU8cConsignmachiningIn(JSON.toJSONString(stringStringMap)); IcGeneralHResultDto icGeneralHResultDto = sendU8cConsignmachiningIn(JSON.toJSONString(stringStringMap));
String cgeneralhid = null; String cgeneralhid = null;
@ -408,6 +409,8 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setRootAppPk(returnOrderHeaderDto.getId()); integrationTaskLivingDetailsEntity.setRootAppPk(returnOrderHeaderDto.getId());
integrationTaskLivingDetailsEntity.setRootAppBill(returnOrderHeaderDto.getCode()); integrationTaskLivingDetailsEntity.setRootAppBill(returnOrderHeaderDto.getCode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
integrationTaskLivingDetailsEntity.setNewSystemNumber(vbillcode);//下游单据编码
integrationTaskLivingDetailsEntity.setNewSystemPrimary(cgeneralhid);//下游单据主键
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) { } catch (Exception e) {
logger.error("推送U8C红字委外入库单失败", e); logger.error("推送U8C红字委外入库单失败", e);

View File

@ -135,6 +135,7 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
* @author liuyang * @author liuyang
*/ */
public void startImplement(String startTime, String endTime) { public void startImplement(String startTime, String endTime) {
long startMillis = System.currentTimeMillis();
String threadNameStrStart = StrUtil.format("开始代理品牌采退OFS采退出库单生成U8C红字采购订单 开始时间:{} 结束时间:{}", startTime, endTime); String threadNameStrStart = StrUtil.format("开始代理品牌采退OFS采退出库单生成U8C红字采购订单 开始时间:{} 结束时间:{}", startTime, endTime);
logger.info(threadNameStrStart); logger.info(threadNameStrStart);
@ -170,7 +171,8 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
} catch (Exception e) { } catch (Exception e) {
logger.error("thread.join()异常", e); logger.error("thread.join()异常", e);
} }
String threadNameStrEnd = StrUtil.format("结束代理品牌采退OFS采退出库单生成U8C红字采购订单 开始时间:{} 结束时间:{}", startTime, endTime); long endMillis = System.currentTimeMillis();
String threadNameStrEnd = StrUtil.format("结束代理品牌采退OFS采退出库单生成U8C红字采购订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
logger.info(threadNameStrEnd); logger.info(threadNameStrEnd);
} }
@ -180,6 +182,7 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
* @author liuyang * @author liuyang
*/ */
public void startImplement(String code) { public void startImplement(String code) {
long startMillis = System.currentTimeMillis();
String threadNameStrStart = StrUtil.format("开始代理品牌采购OFS采购入库单生成U8C采购订单 售后入库单号:{}", code); String threadNameStrStart = StrUtil.format("开始代理品牌采购OFS采购入库单生成U8C采购订单 售后入库单号:{}", code);
logger.info(threadNameStrStart); logger.info(threadNameStrStart);
@ -213,7 +216,8 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
} catch (Exception e) { } catch (Exception e) {
logger.error("thread.join()异常", e); logger.error("thread.join()异常", e);
} }
String threadNameStrEnd = StrUtil.format("结束代理品牌采购OFS采购入库单生成U8C采购订单 售后入库单号:{}", code); long endMillis = System.currentTimeMillis();
String threadNameStrEnd = StrUtil.format("结束代理品牌采购OFS采购入库单生成U8C采购订单 售后入库单号:{} 耗时:{}", code, (endMillis - startMillis));
logger.info(threadNameStrEnd); logger.info(threadNameStrEnd);
} }
@ -463,6 +467,8 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId()); integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId());
integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode()); integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
integrationTaskLivingDetailsEntity.setNewSystemNumber(vordercode);//下游单据编码
integrationTaskLivingDetailsEntity.setNewSystemPrimary(corderid);//下游单据主键
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) { } catch (Exception e) {
logger.error("推送U8C代理品牌红字采购订单采购失败", e); logger.error("推送U8C代理品牌红字采购订单采购失败", e);

View File

@ -133,6 +133,7 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
* @author liuyang * @author liuyang
*/ */
public void startImplement(String startTime, String endTime) { public void startImplement(String startTime, String endTime) {
long startMillis = System.currentTimeMillis();
String threadNameStrStart = StrUtil.format("开始代理品牌采购OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", startTime, endTime); String threadNameStrStart = StrUtil.format("开始代理品牌采购OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", startTime, endTime);
logger.info(threadNameStrStart); logger.info(threadNameStrStart);
@ -167,7 +168,8 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
} catch (Exception e) { } catch (Exception e) {
logger.error("thread.join()异常", e); logger.error("thread.join()异常", e);
} }
String threadNameStrEnd = StrUtil.format("结束代理品牌采购OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{}", startTime, endTime); long endMillis = System.currentTimeMillis();
String threadNameStrEnd = StrUtil.format("结束代理品牌采购OFS采购入库单生成U8C采购订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis));
logger.info(threadNameStrEnd); logger.info(threadNameStrEnd);
} }
@ -177,8 +179,9 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
* @author liuyang * @author liuyang
*/ */
public void startImplement(String code) { public void startImplement(String code) {
String threadNameStr = StrUtil.format("代理品牌采购OFS采购入库单生成U8C采购订单 采购入库单号:{}", code); long startTime = System.currentTimeMillis();
logger.info(threadNameStr); String threadNameStrStart = StrUtil.format("代理品牌采购OFS采购入库单生成U8C采购订单开始 采购入库单号:{}", code);
logger.info(threadNameStrStart);
Thread thread = new Thread(new Runnable() { Thread thread = new Thread(new Runnable() {
@Override @Override
@ -203,13 +206,16 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
logger.error("startImplement方法抛出异常", e); logger.error("startImplement方法抛出异常", e);
} }
} }
}, threadNameStr); }, threadNameStrStart);
thread.start(); thread.start();
try { try {
thread.join(); thread.join();
} catch (Exception e) { } catch (Exception e) {
logger.error("thread.join()异常", e); logger.error("thread.join()异常", e);
} }
long endTime = System.currentTimeMillis();
String threadNameStrEnd = StrUtil.format("代理品牌采购OFS采购入库单生成U8C采购订单结束 采购入库单号:{} 耗时:{}", code, (endTime - startTime));
logger.info(threadNameStrEnd);
} }
/** /**
@ -454,6 +460,8 @@ public class ProxyPurchaseWarehous extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId()); integrationTaskLivingDetailsEntity.setRootAppPk(poOrderSonDto.getId());
integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode()); integrationTaskLivingDetailsEntity.setRootAppBill(poOrderSonDto.getCode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
integrationTaskLivingDetailsEntity.setNewSystemNumber(vordercode);//下游单据编码
integrationTaskLivingDetailsEntity.setNewSystemPrimary(corderid);//下游单据主键
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} catch (Exception e) { } catch (Exception e) {
logger.error("推送U8C代理品牌采购订单采购失败", e); logger.error("推送U8C代理品牌采购订单采购失败", e);

View File

@ -0,0 +1,59 @@
package com.hzya.frame.plugin.lets.plugin.sales;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* O售后订单(仅退款) -> U8C红字应收单
*
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.plugin.sales
* @ProjectkangarooDataCenterV3
* @nameRefundOnly
* @Date2024/9/3 17:19
* @FilenameRefundOnly
*/
public class RefundOnly extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(RefundOnly.class);
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
@Override
public String getPluginId() {
return "sales.RefundOnly";
}
@Override
public String getPluginName() {
return "O售后订单(仅退款)生成U8C红字应收单";
}
@Override
public String getPluginLabel() {
return "O售后订单(仅退款)生成U8C红字应收单";
}
@Override
public String getPluginType() {
return "3";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
return null;
}
}

View File

@ -146,7 +146,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
if (headerDetailsDtoList.size() > 0) { if (headerDetailsDtoList.size() > 0) {
getSet(headerDetailsDtoList); getSet(headerDetailsDtoList);
} else { } else {
logger.info("没有查询到任何数据!不需要同步"); logger.info("TOC没有查询到任何数据!不需要同步");
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("startImplement方法抛出异常", e); logger.error("startImplement方法抛出异常", e);

View File

@ -12,7 +12,7 @@ spring:
dynamic: dynamic:
datasource: datasource:
master: master:
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=3000000&socketTimeout=3000000&autoReconnectForPools=true url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=3000000000&socketTimeout=3000000000&autoReconnectForPools=true
username: root username: root
password: 62e4295b615a30dbf3b8ee96f41c820b password: 62e4295b615a30dbf3b8ee96f41c820b
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置

View File

@ -51,9 +51,9 @@ spring:
strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
druid: druid:
initial-size: 10 # 初始化时建立物理连接的个数。初始化发生在显示调用init方法或者第一次getConnection时 initial-size: 10 # 初始化时建立物理连接的个数。初始化发生在显示调用init方法或者第一次getConnection时
min-idle: 10 # 最小连接池数量 min-idle: 50 # 最小连接池数量
maxActive: 200 # 最大连接池数量 maxActive: 500 # 最大连接池数量
maxWait: 60000 # 获取连接时最大等待时间单位毫秒。配置了maxWait之后缺省启用公平锁并发效率会有所下降如果需要可以通过配置 maxWait: 60000000 # 获取连接时最大等待时间单位毫秒。配置了maxWait之后缺省启用公平锁并发效率会有所下降如果需要可以通过配置
timeBetweenEvictionRunsMillis: 60000 # 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。 timeBetweenEvictionRunsMillis: 60000 # 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。
minEvictableIdleTimeMillis: 300000 # 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间 minEvictableIdleTimeMillis: 300000 # 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间
validationQuery: SELECT 1 FROM DUAL # 验证数据库服务可用性的sql.用来检测连接是否有效的sql 因数据库方言而差, 例如 oracle 应该写成 SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL # 验证数据库服务可用性的sql.用来检测连接是否有效的sql 因数据库方言而差, 例如 oracle 应该写成 SELECT 1 FROM DUAL