diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java index dabc47e78..e8ecf5200 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java @@ -67,7 +67,7 @@ public interface LauncherConstant { /** * sentinel prod 地址 */ - String SENTINEL_PROD_ADDR = "172.30.0.58:8858"; + String SENTINEL_PROD_ADDR = "172.16.128.145:8858"; /** * sentinel test 地址 diff --git a/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java b/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java index 2749bc113..7d5c44bb6 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java +++ b/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java @@ -41,10 +41,10 @@ public class LauncherServiceImpl implements LauncherService { PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); -// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos"); -// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123"); -// PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos"); -// PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123"); + PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos"); + PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123"); + PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos"); + PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123"); PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); diff --git a/blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java b/blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java index c419ea87c..bbb4699d6 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java +++ b/blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java @@ -199,6 +199,8 @@ public class FileUtil extends TimerTask { while ((n = in.read(buff)) >= 0) { out.write(buff, 0, n); } + out.close(); + in.close(); } diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java index 50cb34b91..7575b5f07 100644 --- a/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java @@ -72,9 +72,11 @@ public class BasicMaterialServiceImpl extends BaseServiceImpl data) { + log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}",data); ArrayList arrayList = new ArrayList<>(); for (BasicMaterialExcel datum : data) { + if(ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getProductCode())){ //去重 List basicMaterialEntities = baseMapper.selectList(new QueryWrapper().lambda() diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java index 372a5abbb..acc4e8276 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java @@ -34,29 +34,24 @@ import com.logpm.basicdata.service.IBasicdataVehicleService; import com.logpm.basicdata.vo.BasicdataDriverArteryVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springblade.common.constant.driver.DriverTypeStatusConstant; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; -import org.springblade.system.cache.DictBizCache; import org.springblade.system.entity.User; import org.springblade.system.feign.IUserClient; -import org.springblade.system.feign.IUserSearchClient; +import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import static com.alibaba.fastjson.JSONPatch.OperationType.copy; - /** * 司机信息表 服务实现类 * @@ -68,9 +63,9 @@ import static com.alibaba.fastjson.JSONPatch.OperationType.copy; @Slf4j public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl implements IBasicdataDriverArteryService { - private final BasicdataVehicleMapper basicdataVehicleMapper; + private final BasicdataVehicleMapper basicdataVehicleMapper; - private final IBasicdataVehicleService basicdataVehicleService; + private final IBasicdataVehicleService basicdataVehicleService; private final BasicdataDrivermiddleMapper basicdataDrivermiddleMapper; @@ -103,18 +98,18 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl().lambda().eq(BasicdataDrivermiddleEntity::getDriverId, basicdataDriverArtery.getId())); - if (basicdataDriverArtery.getBindVehicles().equals(""))return delete; + if (basicdataDriverArtery.getBindVehicles().equals("")) return delete; //新增现有的数据 //if (delete>0){ - List bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(",")); - ArrayList basicdataDrivermiddleEntities = new ArrayList<>(); - bindVehicles.forEach(e->{ - BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); - basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId()); - basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e)); - basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity); - }); - basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities); + List bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(",")); + ArrayList basicdataDrivermiddleEntities = new ArrayList<>(); + bindVehicles.forEach(e -> { + BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); + basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId()); + basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e)); + basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity); + }); + basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities); //} return delete; } @@ -127,23 +122,23 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl getDriverList() { BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if (Func.isEmpty(myCurrentWarehouse)){ - log.error("################getDriverList 无当前登录人仓库信息:{}",myCurrentWarehouse); + if (Func.isEmpty(myCurrentWarehouse)) { + log.error("################getDriverList 无当前登录人仓库信息:{}", myCurrentWarehouse); return null; } - log.info("################ getDriverList 仓库信息:{}",myCurrentWarehouse); + log.info("################ getDriverList 仓库信息:{}", myCurrentWarehouse); ArrayList basicdataDriverArteryVOS = new ArrayList<>(); List list = this.list(); - log.info("################getDriverList list:{}",list); + log.info("################getDriverList list:{}", list); //Stream basicdataDriverArteryEntityStream = list.stream().filter(l -> l.getWarehouseId().contains(myCurrentWarehouse.getId().toString())); Stream basicdataDriverArteryEntityStream = list.stream().filter(l -> Func.isNotEmpty(l.getWarehouseId()) && l.getWarehouseId().contains(myCurrentWarehouse.getId().toString())); - if (Func.isNotEmpty(basicdataDriverArteryEntityStream)){ - basicdataDriverArteryEntityStream.forEach(l->{ + if (Func.isNotEmpty(basicdataDriverArteryEntityStream)) { + basicdataDriverArteryEntityStream.forEach(l -> { BasicdataDriverArteryVO driverArteryVO = Func.copy(l, BasicdataDriverArteryVO.class); List vehicleIds = basicdataDrivermiddleService.list(Wrappers.query().lambda() .eq(BasicdataDrivermiddleEntity::getDriverId, l.getId())).stream().filter(f -> Func.isNotEmpty(f.getBrandId())).map(BasicdataDrivermiddleEntity::getBrandId).collect(Collectors.toList()); - if (Func.isNotEmpty(vehicleIds)){ - driverArteryVO.setVehicleVOList(basicdataVehicleService.list(Wrappers.query().lambda().in(BasicdataVehicleEntity::getId,vehicleIds))); + if (Func.isNotEmpty(vehicleIds)) { + driverArteryVO.setVehicleVOList(basicdataVehicleService.list(Wrappers.query().lambda().in(BasicdataVehicleEntity::getId, vehicleIds))); } basicdataDriverArteryVOS.add(driverArteryVO); }); @@ -157,89 +152,100 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl data) { - log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}",data); + @Transactional + public void importDriverArtery(List data) { + log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}", data); outerLoop: for (BasicdataDriverArteryImproterExcel datum : data) { - List driverMiddleEntity = new ArrayList<>(); - //检查数据是否为空 - if (ObjectUtils.isEmpty(datum.getPhone())|| ObjectUtils.isEmpty(datum.getName())|| ObjectUtils.isEmpty(datum.getWarehouseName())|| ObjectUtils.isEmpty(datum.getCarrierName())) { + try { + List driverMiddleEntity = new ArrayList<>(); + + //检查数据是否为空 + if (ObjectUtils.isEmpty(datum.getPhone()) || ObjectUtils.isEmpty(datum.getName()) || ObjectUtils.isEmpty(datum.getWarehouseName()) || ObjectUtils.isEmpty(datum.getCarrierName())) { // log.error("必填数据不能为空"); // continue; - throw new ServiceException("用户"+datum.getName() +"必填数据不能为空!"); - } - if(!ObjectUtils.isEmpty(datum.getPhone())){ - R userR = userClient.userInfoByPhone("627683", datum.getPhone()); - if (userR.getData() == null){ + throw new ServiceException("必填数据不能为空!"); + } + if (!ObjectUtils.isEmpty(datum.getPhone())) { + R userR = userClient.userInfoByPhone("627683", datum.getPhone()); + if (userR.getData() == null) { // log.error("未找到用户"); // continue; - throw new ServiceException("用户"+datum.getName() +"未找到用户!"); - }else { - datum.setUserId(userR.getData().getId()); + throw new ServiceException("未找到用户!"); + } else { + datum.setUserId(userR.getData().getId()); + } } - } - if (!ObjectUtils.isEmpty(datum.getBindVehicle())){ - String[] car = datum.getBindVehicle().split(","); - for (String s : car) { - List carListByName = basicdataVehicleService.findCarListByName(s); + if (!ObjectUtils.isEmpty(datum.getBindVehicle())) { + String[] car = datum.getBindVehicle().split(","); + for (String s : car) { + List carListByName = basicdataVehicleService.findCarListByName(s); - if (carListByName.isEmpty()){ + if (carListByName.isEmpty()) { // log.error("未找到可绑定的车辆"); - throw new ServiceException("用户"+datum.getName() +"未找到可绑定的车辆!"); - }else{ - BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); - basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId()); - driverMiddleEntity.add(basicdataDrivermiddleEntity); + throw new ServiceException("未找到可绑定的车辆!"); + } else { + BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); + basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId()); + driverMiddleEntity.add(basicdataDrivermiddleEntity); + } } } - } - if (!ObjectUtils.isEmpty(datum.getCarrierName())){ - //找到数据库内的承运商 - List basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName,datum.getCarrierName())); + if (!ObjectUtils.isEmpty(datum.getCarrierName())) { + //找到数据库内的承运商 + List basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName, datum.getCarrierName())); - if (ObjectUtils.isEmpty(basicdataCarrierEntities)){ + if (ObjectUtils.isEmpty(basicdataCarrierEntities)) { // log.error("未找到承运商"); // continue; - throw new ServiceException("用户"+datum.getName() +"未找到承运商!"); - }else{ - datum.setCarrierId(basicdataCarrierEntities.get(0).getId()); + throw new ServiceException("未找到承运商!"); + } else { + datum.setCarrierId(basicdataCarrierEntities.get(0).getId()); + } } - } - if (!ObjectUtils.isEmpty(datum.getWarehouseName())){ - //在数据库找到仓库名字对应 - BasicdataWarehouseEntity byName = warehouseClient.findByName(datum.getWarehouseName()); - if (ObjectUtils.isEmpty(byName)){ + if (!ObjectUtils.isEmpty(datum.getWarehouseName())) { + //在数据库找到仓库名字对应 + BasicdataWarehouseEntity byName = warehouseClient.findByName(datum.getWarehouseName()); + if (ObjectUtils.isEmpty(byName)) { // log.error("未找到仓库"); // continue; - throw new ServiceException("用户"+datum.getName() +"未找到仓库!"); - }else{ - datum.setWarehouseId(String.valueOf(byName.getId())); + throw new ServiceException("未找到仓库!"); + } else { + datum.setWarehouseId(String.valueOf(byName.getId())); + } } - } - //根据手机号去重 如果有手机号相同 就删除老数据 - if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) { - List basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper().lambda() - .eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone())); - if (!basicdataVehicleEntities.isEmpty()){ - basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone()); + //根据手机号去重 如果有手机号相同 就删除老数据 + if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) { + List basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone())); + if (!basicdataVehicleEntities.isEmpty()) { + basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone()); + } } - } - BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class); - //连接到前端后取消注释 - BladeUser user = AuthUtil.getUser(); - copy.setTenantId(user.getTenantId());// 租户号 - copy.setUserId(user.getUserId()); // 创建人 - copy.setUpdateUser(user.getUserId());// 更新人 - log.info("复制后>>>>>>>>>>>>{}",copy); + BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class); + //连接到前端后取消注释 + BladeUser user = AuthUtil.getUser(); + copy.setTenantId(user.getTenantId());// 租户号 + copy.setUserId(user.getUserId()); // 创建人 + copy.setUpdateUser(user.getUserId());// 更新人 + log.info("复制后>>>>>>>>>>>>{}", copy); this.save(copy); //车辆和司机绑定关系 - for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) { - basicdataDrivermiddleEntity.setDriverId(copy.getId()); - basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity); + for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) { + basicdataDrivermiddleEntity.setDriverId(copy.getId()); + basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity); + } + } catch (DataAccessException e) { + throw new ServiceException("用户" + datum.getName() + "数据长度异常"); + } catch (ServiceException e) { + throw new ServiceException("用户" + datum.getName() + e.getMessage()); + } catch (Exception e) { + throw new RuntimeException("用户" + datum.getName() + "数据错误" + e.getMessage()); } + } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java index dc09200db..ca8cca51c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java @@ -168,7 +168,7 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl myWarehouseList = getMyWarehouseList(); - if (myWarehouseList != null) { - if (myWarehouseList.size() == 1) { - return myWarehouseList.get(0); + try { + BladeUser user = AuthUtil.getUser(); + String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId())); + if (StringUtil.isBlank(json)) { + List myWarehouseList = getMyWarehouseList(); + if (myWarehouseList != null) { + if (myWarehouseList.size() == 1) { + return myWarehouseList.get(0); + } } } + BasicdataWarehouseEntity o = JSONObject.parseObject(json, BasicdataWarehouseEntity.class); + return o; + } catch (Exception e) { + + log.error(">>>>>> 获取仓库信息错误",e); } - BasicdataWarehouseEntity o = JSONObject.parseObject(json, BasicdataWarehouseEntity.class); - return o; + + return null; + } @Override diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index 47ac0d799..f6a916587 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -65,6 +65,7 @@ import org.springblade.common.constant.reservation.ReservationPackageStatusConst import org.springblade.common.constant.reservation.ReservationSigningStatusConstant; import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.constant.stockup.StockupTypeStatusConstant; +import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.log.exception.ServiceException; @@ -1505,6 +1506,8 @@ public class DistributionStockupAppController extends BladeController { */ @NotNull private R stockupScanByCustom(StockupDTO stockupDTO) { + + //包件扫描 String orderCode = stockupDTO.getOrderCode();//订单自编号 String packetBarCode = stockupDTO.getPacketBarCode();//包件码 @@ -1589,9 +1592,16 @@ public class DistributionStockupAppController extends BladeController { map.put("logId", entity.getId()); map.put("messageData", entity); map.put("createTime", new Date().getTime()); + + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + log.info(">>>> find bug myCurrentWarehouse {}",myCurrentWarehouse); + if (Objects.isNull(myCurrentWarehouse)) { + throw new CustomerException(403, "仓库信息不能为空"); + } //将消息携带绑定键值 rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); + //查询是否货位数据是否该下架 Map mapState = new HashMap<>(); mapState.put("messageId", CommonUtil.getUUID()); @@ -1601,6 +1611,7 @@ public class DistributionStockupAppController extends BladeController { mapState.put("reservationId", stockupDTO.getReservationId()); mapState.put("logId", entity.getId()); mapState.put("messageData", entity); + mapState.put("warehouseId",myCurrentWarehouse.getId()); mapState.put("createTime", new Date().getTime()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index f9ae56dcd..4672d55b8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -465,7 +465,6 @@ INNER JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id INNER JOIN logpm_distribution_reservation AS ldr ON ldr.id = lds.reservation_id - ldr.reservation_status != '40' and lddl.id = #{id} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java index 8378e7ca7..814b17f1c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java @@ -301,4 +301,12 @@ public interface DistributionSignforMapper extends BaseMapper SELECT * FROM logpm_distribution_signfor WHERE reservation_id = #{reservationId} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java index 9e1e0416d..ecdeb8d25 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java @@ -40,6 +40,7 @@ public class StockupStateUpdateHandler { messageData.setStockupId((Long) map.get("stockupId")); messageData.setTypeService(String.valueOf( map.get("typeService"))); messageData.setReservationId((Long) map.get("reservationId")); + messageData.setWarehouseId((Long)map.get("warehouseId")); //查询是否货位数据是否该下架 distributionAsyncService.stockupSelfOffShelf(messageData); log.info("######STOCKUP_STATE_UPDATE_QUEUE:备货下架查询成功"); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index bd76a2a1c..bd8587232 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -155,7 +155,7 @@ public interface IDistributionDeliveryListService extends BaseService selectDistributionAppDeliverywrapIn( DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); /** - * 修改配送任务 + * 修改商配配送任务 * @param deliveryListDTO * @return */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index 0af063f3f..4c073fd09 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -643,11 +643,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { */ @Override public void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException { - BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - log.info(">>>> find bug {}",myCurrentWarehouse); - if (Objects.isNull(myCurrentWarehouse)) { - throw new CustomerException(403, "仓库信息不能为空"); - } + //判断类型 List distributionStockupSelfVO = new ArrayList<>(); @@ -656,7 +652,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { distributionStockupSelfVO = distributionStockupMapper.stockupSelfOffShelf(stockupDTO); } else { //商 市 - log.info(">>>> find bug {}",stockupDTO); + log.info(">>>> find bug stockupDTO {}",stockupDTO); distributionStockupSelfVO = distributionStockupMapper.stockupOffShelf(stockupDTO); } //有 @@ -678,7 +674,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (a.get() == b.get()) { //下架 list.forEach(i -> { - warehouseUpdownTypeClient.downPackage(i, myCurrentWarehouse.getId()); + warehouseUpdownTypeClient.downPackage(i, stockupDTO.getWarehouseId()); }); } 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 3ba29e112..3eb659eea 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 @@ -2964,9 +2964,20 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda() + .eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()) + .eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId()) + ); + if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); + throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); + } + //查询出该预约下的订单信息 List reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()).ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); Map> oldOrder = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId)); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 6701cc86b..fa44537e7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -2317,7 +2317,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionCancelReservationPackageDTO.getReservationId()); + String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(",")); for (String s : split) { if (Func.isNotEmpty(distributionParcelListEntities)){ List cancelPackage = distributionParcelListEntities.stream().filter(p -> p.getId().equals(Long.parseLong(s))).collect(Collectors.toList()); @@ -3617,6 +3620,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl