长泰修改,配置多数据源

dev
anthonywj 1 year ago
parent 685960b5cb
commit 58b3c1b08e

@ -56,6 +56,12 @@
<artifactId>p6spy</artifactId>
<version>3.9.1</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -124,7 +130,7 @@
</dependency>
<!--okhttp-->
<!-- <dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.squareup.okhttp3</groupId>-->
<!-- <artifactId>okhttp</artifactId>-->
<!-- <version>4.10.0</version>-->

@ -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<UdiwmsOrderDetailRequest> items = new ArrayList<>();
//查询业务单据详情
List<IoOrderDetailBizEntity> detailBizEntities = orderDetailBizDao.selectList(new QueryWrapper<IoOrderDetailBizEntity>().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<IoCodeEntity> ioCodeEntities, List<UdiwmsOrderDetailRequest> orderDetailRequests, List<IoOrderDetailBizEntity> detailBizEntities) {
private String setOrderDetailList(List<IoCodeEntity> ioCodeEntities, List<UdiwmsOrderDetailRequest> orderDetailRequests, List<IoOrderDetailBizEntity> 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<ThrProductsEntity>()
.eq(ThrProductsEntity::getCode, thirdProductId).last("limit 1"));
if (thrProductsEntity == null) {
// log.error("第三方产品编码未关联");
log.error("第三方产品编码未关联");
return null;
}
item.setProductName(thrProductsEntity.getName()); //产品名称

@ -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

Loading…
Cancel
Save