diff --git a/pom.xml b/pom.xml
index 18081f2..bf72725 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,6 +56,12 @@
p6spy
3.9.1
+
+ com.baomidou
+ dynamic-datasource-spring-boot-starter
+ 3.4.1
+
+
org.springframework.boot
@@ -124,7 +130,7 @@
-
+
diff --git a/src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java b/src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java
index 404b0c2..53d0aea 100644
--- a/src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java
+++ b/src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java
@@ -547,6 +547,9 @@ public class CtqyyClient extends CommonHttpClient {
zaxzyyOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName());
} catch (Exception e) {
log.error("查询第三方系统仓库信息异常", e);
+ String msg = "查询第三方系统仓库信息异常";
+ orderUploadLogService.updateLocalErr(orderEntity, msg);
+ return ResultVOUtils.error(500, msg);
}
//设置单据出入库类型
@@ -566,11 +569,17 @@ public class CtqyyClient extends CommonHttpClient {
List items = new ArrayList<>();
//查询业务单据详情
List detailBizEntities = orderDetailBizDao.selectList(new QueryWrapper().eq("orderIdFk", orderEntity.getBillNo()));
- setOrderDetailList(ioCodeEntities, items, detailBizEntities);
+ String errMsg = setOrderDetailList(ioCodeEntities, items, detailBizEntities);
zaxzyyOrderRequest.setItem(items);
if (CollUtil.isEmpty(items)) {
- log.error("\"产品信息对照异常,无法上传\"");
- return ResultVOUtils.error(500, "产品信息对照异常,无法上传");
+ String msg = "查询第三方系统仓库信息异常";
+ orderUploadLogService.updateLocalErr(orderEntity, msg);
+ return ResultVOUtils.error(500, msg);
+ }
+
+ if (StrUtil.isNotEmpty(errMsg)) {
+ orderUploadLogService.updateLocalErr(orderEntity, errMsg);
+ return ResultVOUtils.error(500, errMsg);
}
@@ -1013,7 +1022,8 @@ public class CtqyyClient extends CommonHttpClient {
* @param orderDetailRequests 单据详情参数
* @param detailBizEntities 单据业务详情
*/
- private void setOrderDetailList(List ioCodeEntities, List orderDetailRequests, List detailBizEntities) {
+ private String setOrderDetailList(List ioCodeEntities, List orderDetailRequests, List detailBizEntities) {
+ String errMsg = "";
for (IoOrderDetailBizEntity detailBizEntity : detailBizEntities) {
IoOrderDetailCodeEntity orderDetailCodeEntity = orderDetailCodeDao
@@ -1029,9 +1039,12 @@ public class CtqyyClient extends CommonHttpClient {
//封装条码信息
submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item);
orderDetailRequests.add(item);
+ } else {
+ errMsg = detailBizEntity.getCoName() + ",";
}
}
}
+ return errMsg;
}
@@ -1055,7 +1068,7 @@ public class CtqyyClient extends CommonHttpClient {
ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new LambdaQueryWrapper()
.eq(ThrProductsEntity::getCode, thirdProductId).last("limit 1"));
if (thrProductsEntity == null) {
-// log.error("第三方产品编码未关联");
+ log.error("第三方产品编码未关联");
return null;
}
item.setProductName(thrProductsEntity.getName()); //产品名称
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 3ab9057..c1a14cc 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -1,10 +1,20 @@
spring:
datasource:
- driver-class-name: com.p6spy.engine.spy.P6SpyDriver
- url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
- username: root
- password: 123456
- hikari:
- connection-timeout: 60000
- maximum-pool-size: 60
- minimum-idle: 10
+ dynamic:
+ primary: master
+ strict: false
+ datasource:
+ master:
+ url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
+ username: root
+ password: 123456
+ driver-class-name: com.p6spy.engine.spy.P6SpyDriver
+ hikari:
+ connection-timeout: 60000
+ maximum-pool-size: 60
+ minimum-idle: 10
+ njsql:
+ url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_ct?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
+ username: root
+ password: 123456
+ driver-class-name: com.p6spy.engine.spy.P6SpyDriver