From c932cde227de45c785bacdd8ccf62bbd2c8650b9 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 18 Dec 2024 17:40:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=85=A5=E5=BA=93=E7=9A=84?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=9C=8D=E5=8A=A1=E4=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/BasicdataTripartiteMallFeignDTO.java | 10 ++++ .../feign/IBasicdataTripartiteMallClient.java | 7 ++- .../BasicdataTripartiteMallController.java | 2 - .../feign/BasicdataTripartiteMallClient.java | 55 +++++++++++++------ .../mapper/BasicdataTripartiteMallMapper.java | 1 - .../IBasicdataTripartiteMallService.java | 1 - .../BasicdataTripartiteMallServiceImpl.java | 2 - .../service/impl/InComingServiceImpl.java | 53 ++++++++++-------- 8 files changed, 81 insertions(+), 50 deletions(-) create mode 100644 blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/dto/BasicdataTripartiteMallFeignDTO.java diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/dto/BasicdataTripartiteMallFeignDTO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/dto/BasicdataTripartiteMallFeignDTO.java new file mode 100644 index 000000000..736ce57f8 --- /dev/null +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/dto/BasicdataTripartiteMallFeignDTO.java @@ -0,0 +1,10 @@ +package com.logpm.basicdata.dto; + +import lombok.Data; + +@Data +public class BasicdataTripartiteMallFeignDTO { + private String dealerName; + private String dealerCode; + private String brand; +} diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTripartiteMallClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTripartiteMallClient.java index 009de8371..1f1e8d92a 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTripartiteMallClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTripartiteMallClient.java @@ -16,11 +16,14 @@ */ package com.logpm.basicdata.feign; +import com.logpm.basicdata.dto.BasicdataTripartiteMallFeignDTO; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -54,6 +57,6 @@ public interface IBasicdataTripartiteMallClient { @GetMapping(API_PREFIX+"/getClientIdByNameAndBrandAndCode") Long getClientIdByNameAndBrandAndCode(@RequestParam String name, @RequestParam String code,@RequestParam String brand); - @GetMapping(API_PREFIX+"/findEntityByDealerNameAndDealerCodeAndBrand") - BasicdataTripartiteMallEntity findEntityByDealerNameAndDealerCodeAndBrand(@RequestParam String dealerName, @RequestParam String dealerCode, @RequestParam String brand); + @PostMapping(API_PREFIX+"/findEntityByDealerNameAndDealerCodeAndBrand") + BasicdataTripartiteMallEntity findEntityByDealerNameAndDealerCodeAndBrand(@RequestBody BasicdataTripartiteMallFeignDTO basicdataTripartiteMallDTO); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java index 8eafb7aea..d26bd7339 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java @@ -20,7 +20,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.logpm.basicdata.dto.BasicdataTripartiteMallDTO; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel; import com.logpm.basicdata.service.IBasicdataTripartiteMallService; @@ -37,7 +36,6 @@ import org.springblade.core.secure.BladeUser; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.DateUtil; -import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTripartiteMallClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTripartiteMallClient.java index 44ae55521..339924922 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTripartiteMallClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTripartiteMallClient.java @@ -19,12 +19,14 @@ package com.logpm.basicdata.feign; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.basicdata.dto.BasicdataTripartiteMallFeignDTO; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; import com.logpm.basicdata.service.IBasicdataTripartiteMallService; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; @@ -42,38 +44,55 @@ import java.util.List; @AllArgsConstructor public class BasicdataTripartiteMallClient implements IBasicdataTripartiteMallClient { - private final IBasicdataTripartiteMallService basicdataTripartiteMallService; + private final IBasicdataTripartiteMallService basicdataTripartiteMallService; - @Override - @GetMapping(TOP) - public BladePage top(Integer current, Integer size) { - Query query = new Query(); - query.setCurrent(current); - query.setSize(size); - IPage page = basicdataTripartiteMallService.page(Condition.getPage(query)); - return BladePage.of(page); - } + @Override + @GetMapping(TOP) + public BladePage top(Integer current, Integer size) { + Query query = new Query(); + query.setCurrent(current); + query.setSize(size); + IPage page = basicdataTripartiteMallService.page(Condition.getPage(query)); + return BladePage.of(page); + } @Override public Long getClientIdByNameAndBrand(String name, String brand) { - return basicdataTripartiteMallService.getClientIdByNameAndBrand(name,brand); + return basicdataTripartiteMallService.getClientIdByNameAndBrand(name, brand); } @Override public Long getClientIdByNameAndBrandAndCode(String name, String code, String brand) { - return basicdataTripartiteMallService.getClientIdByNameAndBrandAndCode(name,code,brand); + return basicdataTripartiteMallService.getClientIdByNameAndBrandAndCode(name, code, brand); } @Override - public BasicdataTripartiteMallEntity findEntityByDealerNameAndDealerCodeAndBrand(String dealerName, String dealerCode, String brand) { + public BasicdataTripartiteMallEntity findEntityByDealerNameAndDealerCodeAndBrand(BasicdataTripartiteMallFeignDTO basicdataTripartiteMallDTO) { + if (basicdataTripartiteMallDTO == null) { + return null; + } + if (StringUtil.isBlank(basicdataTripartiteMallDTO.getDealerName()) && + StringUtil.isBlank(basicdataTripartiteMallDTO.getDealerCode()) && + StringUtil.isBlank(basicdataTripartiteMallDTO.getBrand()) + ) { + return null; + } + QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("tripartite_mall",dealerName) - .eq("tripartite_coding",dealerCode) - .eq("brand_name",brand); + if (!StringUtil.isBlank(basicdataTripartiteMallDTO.getDealerName())) { + queryWrapper.eq("tripartite_mall", basicdataTripartiteMallDTO.getDealerName()); + } + if (!StringUtil.isBlank(basicdataTripartiteMallDTO.getDealerCode())) { + queryWrapper.eq("tripartite_coding", basicdataTripartiteMallDTO.getDealerCode()); + } + if (!StringUtil.isBlank(basicdataTripartiteMallDTO.getBrand())) { + queryWrapper.eq("brand_name", basicdataTripartiteMallDTO.getBrand()); + } + List list = basicdataTripartiteMallService.list(queryWrapper); - if(CollUtil.isEmpty(list)){ + if (CollUtil.isEmpty(list)) { return null; - }else{ + } else { return list.get(0); } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.java index 3e0adbea0..b75e76553 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.java @@ -19,7 +19,6 @@ package com.logpm.basicdata.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.logpm.basicdata.dto.BasicdataTripartiteMallDTO; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel; import com.logpm.basicdata.vo.BasicdataTripartiteMallVO; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java index f99b0b937..62c43e7f3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java @@ -18,7 +18,6 @@ package com.logpm.basicdata.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.logpm.basicdata.dto.BasicdataTripartiteMallDTO; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; import com.logpm.basicdata.excel.BasicdataTripartiteMallExcel; import com.logpm.basicdata.vo.BasicdataTripartiteMallVO; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java index 64a890f72..28b5c38c1 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java @@ -16,11 +16,9 @@ */ package com.logpm.basicdata.service.impl; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.logpm.basicdata.dto.BasicdataTripartiteMallDTO; import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataClientLogEntity; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index 846b8bcd9..56275a692 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.basicdata.dto.BasicdataTripartiteMallFeignDTO; import com.logpm.basicdata.entity.BasicdataStorageServicesEntity; import com.logpm.basicdata.entity.BasicdataTripartiteMallEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; @@ -193,13 +194,13 @@ public class InComingServiceImpl implements IInComingService { String sendWarehouse = null; String endWarehouse = null; List byPacketBarCode = parcelListClient.findByPacketBarCode(packageCode); - if(CollUtil.isNotEmpty(byPacketBarCode)){ + if (CollUtil.isNotEmpty(byPacketBarCode)) { DistributionParcelListEntity parcelListEntity = byPacketBarCode.get(0); - if(ObjectUtil.isNotEmpty(parcelListEntity)){ - if(StrUtil.isNotEmpty(parcelListEntity.getSendWarehouseName())){ + if (ObjectUtil.isNotEmpty(parcelListEntity)) { + if (StrUtil.isNotEmpty(parcelListEntity.getSendWarehouseName())) { sendWarehouse = parcelListEntity.getSendWarehouseName(); } - if(StrUtil.isNotEmpty(parcelListEntity.getAcceptWarehouseName())){ + if (StrUtil.isNotEmpty(parcelListEntity.getAcceptWarehouseName())) { endWarehouse = parcelListEntity.getAcceptWarehouseName(); } } @@ -241,7 +242,7 @@ public class InComingServiceImpl implements IInComingService { Long warehouseId = inComingDTO.getWarehouseId();//仓库id String warehouseName = inComingDTO.getWarehouseName(); Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 10补录数据入库 - try{ + try { if (StringUtil.isBlank(warehouseName)) { BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId); @@ -406,7 +407,7 @@ public class InComingServiceImpl implements IInComingService { Tenant tenant = result.getData(); - if (tenant!=null && tenant.getTenantType() == 1) { + if (tenant != null && tenant.getTenantType() == 1) { // 发送入库消息 OrderStatusDTO orderStatusDTO = new OrderStatusDTO(); // 通过包件id 查询包件 @@ -421,13 +422,13 @@ public class InComingServiceImpl implements IInComingService { String sendWarehouse = null; String endWarehouse = null; List byPacketBarCode = parcelListClient.findByPacketBarCode(advanceDetailEntity.getOrderPackageCode()); - if(CollUtil.isNotEmpty(byPacketBarCode)){ + if (CollUtil.isNotEmpty(byPacketBarCode)) { DistributionParcelListEntity parcelListEntity = byPacketBarCode.get(0); - if(ObjectUtil.isNotEmpty(parcelListEntity)){ - if(StrUtil.isNotEmpty(parcelListEntity.getSendWarehouseName())){ + if (ObjectUtil.isNotEmpty(parcelListEntity)) { + if (StrUtil.isNotEmpty(parcelListEntity.getSendWarehouseName())) { sendWarehouse = parcelListEntity.getSendWarehouseName(); } - if(StrUtil.isNotEmpty(parcelListEntity.getAcceptWarehouseName())){ + if (StrUtil.isNotEmpty(parcelListEntity.getAcceptWarehouseName())) { endWarehouse = parcelListEntity.getAcceptWarehouseName(); } } @@ -451,7 +452,7 @@ public class InComingServiceImpl implements IInComingService { .build())) .build(); factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg); - } else if (tenant!=null && tenant.getTenantType() == 2) { + } else if (tenant != null && tenant.getTenantType() == 2) { // 完结预入库数据状态 // JSONObject jsonObject = new JSONObject(); // jsonObject.put("orderPackageCode", advanceDetailEntity.getOrderPackageCode()); @@ -559,7 +560,11 @@ public class InComingServiceImpl implements IInComingService { return Resp.scanSuccess("商家为" + dealerName, "商家为" + dealerName); } } else { - BasicdataTripartiteMallEntity tripartiteMallEntity = tripartiteMallClient.findEntityByDealerNameAndDealerCodeAndBrand(dealerName, dealerCode, brand); + BasicdataTripartiteMallFeignDTO basicdataTripartiteMallFeignDTO = new BasicdataTripartiteMallFeignDTO(); + basicdataTripartiteMallFeignDTO.setDealerName(dealerName); + basicdataTripartiteMallFeignDTO.setDealerCode(dealerCode); + basicdataTripartiteMallFeignDTO.setBrand(brand); + BasicdataTripartiteMallEntity tripartiteMallEntity = tripartiteMallClient.findEntityByDealerNameAndDealerCodeAndBrand(basicdataTripartiteMallFeignDTO); if (!Objects.isNull(tripartiteMallEntity)) { Long clientId = tripartiteMallEntity.getClientId(); BasicdataStorageServicesEntity storageServicesEntity = storageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId); @@ -578,8 +583,8 @@ public class InComingServiceImpl implements IInComingService { throw e; } - if(CollUtil.isNotEmpty(sendAdvanceDetailEntityList)){ - advanceDetailService.sendReportIncomingData(AuthUtil.getUserId(),AuthUtil.getNickName(),sendAdvanceDetailEntityList,warehouseId,warehouseName,incomingType); + if (CollUtil.isNotEmpty(sendAdvanceDetailEntityList)) { + advanceDetailService.sendReportIncomingData(AuthUtil.getUserId(), AuthUtil.getNickName(), sendAdvanceDetailEntityList, warehouseId, warehouseName, incomingType); } String a = audio.get(); @@ -833,7 +838,7 @@ public class InComingServiceImpl implements IInComingService { //查询所有包件 List detailList = advanceDetailService.list(queryWrapper); - List orderPackageCodes = advanceService.incomingPackageBatch(advanceId, warehouseId, detailList, userId, deptId, tenantId, waybillEntity,incomingType); + List orderPackageCodes = advanceService.incomingPackageBatch(advanceId, warehouseId, detailList, userId, deptId, tenantId, waybillEntity, incomingType); advanceDetailService.updateBatchById(detailList); @@ -869,21 +874,21 @@ public class InComingServiceImpl implements IInComingService { } - if(CollUtil.isNotEmpty(sendAdvanceDetailEntityList)){ + if (CollUtil.isNotEmpty(sendAdvanceDetailEntityList)) { try { if (CollUtil.isNotEmpty(sendAdvanceDetailEntityList)) { for (TrunklineAdvanceDetailEntity advanceDetailEntity : sendAdvanceDetailEntityList) { String waybillNo = advanceDetailEntity.getWaybillNo(); String sendWarehouse = null; String endWarehouse = null; - if(StrUtil.isNotEmpty(waybillNo)){ - if(waybillEntityMap.containsKey(waybillNo)){ + if (StrUtil.isNotEmpty(waybillNo)) { + if (waybillEntityMap.containsKey(waybillNo)) { WarehouseWaybillEntity warehouseWaybillEntity = waybillEntityMap.get(waybillNo); - if(ObjectUtil.isNotEmpty(warehouseWaybillEntity)){ - if(StrUtil.isNotEmpty(warehouseWaybillEntity.getDepartureWarehouseName())){ + if (ObjectUtil.isNotEmpty(warehouseWaybillEntity)) { + if (StrUtil.isNotEmpty(warehouseWaybillEntity.getDepartureWarehouseName())) { sendWarehouse = warehouseWaybillEntity.getDepartureWarehouseName(); } - if(StrUtil.isNotEmpty(warehouseWaybillEntity.getDestinationWarehouseName())){ + if (StrUtil.isNotEmpty(warehouseWaybillEntity.getDestinationWarehouseName())) { endWarehouse = warehouseWaybillEntity.getDestinationWarehouseName(); } } @@ -911,10 +916,10 @@ public class InComingServiceImpl implements IInComingService { factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg); } } - }catch (Exception e){ - log.error("始发仓入库推送工厂消息异常",e); + } catch (Exception e) { + log.error("始发仓入库推送工厂消息异常", e); } - advanceDetailService.sendReportIncomingData(AuthUtil.getUserId(),AuthUtil.getNickName(),sendAdvanceDetailEntityList,warehouseId,warehouseName,incomingType); + advanceDetailService.sendReportIncomingData(AuthUtil.getUserId(), AuthUtil.getNickName(), sendAdvanceDetailEntityList, warehouseId, warehouseName, incomingType); } // DynamicDataSourceContextHolder.clear();