diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 0463bbd35..6ef91e627 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -6579,6 +6579,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl materialNameStrList = distributionReservationMapper.getMaterialNameByStockArticleIdAndReservationId(stockArticleId, reservationId); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/TrunkLineApplication.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/TrunkLineApplication.java index d17b93470..5e3b60b60 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/TrunkLineApplication.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/TrunkLineApplication.java @@ -19,6 +19,7 @@ package com.logpm.trunkline; import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.cloud.client.BladeCloudApplication; import org.springblade.core.launch.BladeApplication; +import org.springblade.core.transaction.annotation.SeataCloudApplication; /** * Demo启动器 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/launcher/TrunklineLauncherServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/launcher/TrunklineLauncherServiceImpl.java index 2aa87c40f..910a9d40d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/launcher/TrunklineLauncherServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/launcher/TrunklineLauncherServiceImpl.java @@ -16,6 +16,7 @@ */ package com.logpm.trunkline.launcher; +import org.springblade.common.constant.LauncherConstant; import org.springblade.core.auto.service.AutoService; import org.springblade.core.launch.constant.NacosConstant; import org.springblade.core.launch.service.LauncherService; @@ -41,6 +42,21 @@ public class TrunklineLauncherServiceImpl implements LauncherService { PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].data-id", NacosConstant.dataId(appName, profile)); PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].group", NacosConstant.NACOS_CONFIG_GROUP); PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH); + + // 分布式事物 +// seata注册地址 +// PropsUtil.setProperty(props, "seata.service.grouplist.default", LauncherConstant.seataAddr(profile)); +//// seata注册group格式 +//// PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName)); +//// seata配置服务group +// PropsUtil.setProperty(props, "seata.service.vgroup-mapping.default_tx_group".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE); +//// seata注册模式配置 +// PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE); +// PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile)); +// PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE); +// PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile)); + + // 指定注册IP // PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.ip", "127.0.0.1"); // 指定注册端口 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 45db9235e..e320fcd2f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.basic.entity.BasicMaterialEntity; import com.logpm.basic.feign.IBasicMaterialClient; @@ -27,6 +28,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; import com.logpm.warehouse.vo.WarehouseWaybillVO; +import io.seata.spring.annotation.GlobalTransactional; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.CodeNumConstant; @@ -34,6 +36,7 @@ import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.order.*; import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; @@ -270,7 +273,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { return R.success("验证成功"); } - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = ServiceException.class) @Override public R openWaybill(OpenOrderDTO openOrderDTO) { log.info("############openWaybill: 开单开始 openOrderDTO={}",openOrderDTO); @@ -379,6 +382,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setDocumentMakingTime(CommonUtil.StringToDate(openOrderDTO.getOpenOrderDate())); Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity); + if(!Objects.isNull(waybillId)){ log.info("#################openWaybill: 运单保存成功"); //保存运单货物明细 diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java index bbab0922f..cbeb3304b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java @@ -1077,6 +1077,8 @@ public class WarehouseUpdownTypeApiController { if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息不能为空"); return R.fail(403,"仓库信息不能为空"); + + } //查询该库位的货物信息 return warehouseUpdownTypeService.findAllAllocationId(myCurrentWarehouse.getId()); diff --git a/blade-service/pom.xml b/blade-service/pom.xml index 535de3403..b21f8d8b1 100644 --- a/blade-service/pom.xml +++ b/blade-service/pom.xml @@ -61,6 +61,11 @@ org.springblade blade-starter-metrics + + + org.springblade + blade-starter-transaction + org.springblade blade-starter-tenant