diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java index 76b62614f..dcb269ca8 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java @@ -99,4 +99,7 @@ public class OpenOrderDTO implements Serializable { private String url; + + + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java index c9a7c02f4..5ffede0b8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java @@ -1,5 +1,7 @@ package com.logpm.trunkline.controller; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; @@ -8,7 +10,9 @@ import com.logpm.trunkline.dto.AdvanceDTO; import com.logpm.trunkline.dto.OpenLabelDTO; import com.logpm.trunkline.dto.OpenOrderDTO; import com.logpm.trunkline.dto.WaybillDetailDTO; +import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.service.IOpenOrderService; +import com.logpm.trunkline.service.ITrunklineCarsLoadService; import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import com.logpm.trunkline.vo.TrunklineAdvanceVO; import io.swagger.annotations.Api; @@ -34,6 +38,7 @@ public class OpenOrderController { private final IBasicdataWarehouseClient warehouseClient; private final IOpenOrderService openOrderService; + private final ITrunklineCarsLoadService carsLoadService; @ResponseBody @PostMapping("/advancePageList") @@ -1080,7 +1085,15 @@ public class OpenOrderController { return R.fail(403,"仓库信息为空"); } - return openOrderService.openLabelHasPacakage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file); + R> listR = openOrderService.openLabelHasPacakage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file); + List data = listR.getData(); + if(!CollUtil.isEmpty(data)){ + for (TrunklineAdvanceEntity datum : data) { + carsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(datum)); + } + } + + return listR; }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); @@ -1106,7 +1119,15 @@ public class OpenOrderController { return R.fail(403,"仓库信息为空"); } - return openOrderService.importOrderNoPackage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file); + R> listR = openOrderService.importOrderNoPackage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file); +// List data = listR.getData(); +// if(!CollUtil.isEmpty(data)){ +// for (TrunklineAdvanceEntity datum : data) { +// carsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(datum)); +// } +// } + + return listR; }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); @@ -1135,7 +1156,14 @@ public class OpenOrderController { return R.fail(403,"仓库信息为空"); } - return openOrderService.importCustomizedOuPai(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file); + R> listR = openOrderService.importCustomizedOuPai(myCurrentWarehouse.getId(), myCurrentWarehouse.getName(), file); + List data = listR.getData(); + if(!CollUtil.isEmpty(data)){ + for (TrunklineAdvanceEntity datum : data) { + carsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(datum)); + } + } + return listR; }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); @@ -1162,7 +1190,14 @@ public class OpenOrderController { return R.fail(403,"仓库信息为空"); } - return openOrderService.importStandardOuPai(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file); + R> listR = openOrderService.importStandardOuPai(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file); + List data = listR.getData(); + if(!CollUtil.isEmpty(data)){ + for (TrunklineAdvanceEntity datum : data) { + carsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(datum)); + } + } + return listR; }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml index c65f3d87f..1e0fade47 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml @@ -15,7 +15,7 @@ select lta.*, lbc.client_name htMallName from logpm_trunkline_advance lta - left join logpm_basicdata_tripartite_mall lbtm on lbtm.tripartite_mall = lta.dealer_name and lbtm.brand_name = lta.brand + left join logpm_basicdata_tripartite_mall lbtm on lbtm.tripartite_mall = lta.dealer_name and lbtm.brand_name = lta.brand and lta.dealer_code = lbtm.tripartite_coding left join logpm_basicdata_client lbc on lbc.id = lbtm.client_id where lta.is_deleted = 0 and lta.waybill_status = 0 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java index d433be385..c807177cd 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.trunkline.dto.AdvanceDTO; import com.logpm.trunkline.dto.OpenLabelDTO; import com.logpm.trunkline.dto.OpenOrderDTO; +import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import com.logpm.trunkline.vo.TrunklineAdvanceVO; import org.springblade.core.tool.api.R; @@ -43,11 +44,11 @@ public interface IOpenOrderService { R openLabel(OpenLabelDTO openLabelDTO); - R openLabelHasPacakage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; + R> openLabelHasPacakage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; - R importCustomizedOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; + R> importCustomizedOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; - R importStandardOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; + R> importStandardOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; R findWaybillDetail(OpenOrderDTO openOrderDTO); @@ -61,7 +62,7 @@ public interface IOpenOrderService { R findPayWayByClientId(Long clientId); - R importOrderNoPackage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; + R> importOrderNoPackage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException; R checkWaybill(OpenOrderDTO openOrderDTO); 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 23009258f..74f06958c 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 @@ -963,7 +963,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { @Transactional(rollbackFor = Exception.class) @Override - public R openLabelHasPacakage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { + public R> openLabelHasPacakage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { if(Objects.isNull(file)){ log.warn("##################openLabelHasPacakage: 文件不存在"); return R.fail(405,"文件不存在"); @@ -979,7 +979,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Set set = listMap.keySet(); List advanceDetailEntities = new ArrayList<>(); - + List advanceEntityList = new ArrayList<>(); for (String str : set) { List detailExcelDTOS = listMap.get(str); PacakgeDetailExcelDTO pacakgeDetailExcelDTO = detailExcelDTOS.get(0); @@ -1026,6 +1026,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceEntity.setLegacyStatus("0"); advanceEntity.setCreateUserName(AuthUtil.getNickName()); advanceService.save(advanceEntity); + advanceEntityList.add(advanceEntity); }else{ Long advanceId = advanceEntity.getId(); orderPackageCodes = advanceDetailService.findOrderPackageCodesByAdvanceId(advanceId); @@ -1100,12 +1101,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } advanceDetailService.saveBatch(advanceDetailEntities); - return R.success("导入成功"); + return R.data(advanceEntityList); } @Transactional(rollbackFor = Exception.class) @Override - public R importCustomizedOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { + public R> importCustomizedOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { if(Objects.isNull(file)){ log.warn("##################openLabelHasPacakage: 文件不存在"); return R.fail(405,"文件不存在"); @@ -1122,7 +1123,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Set set = listMap.keySet(); - + List advanceEntityList = new ArrayList<>(); List advanceDetailEntities = new ArrayList<>(); for (String str : set) { List paiDTOList = listMap.get(str); @@ -1161,12 +1162,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService { trunklineAdvanceEntity.setDeliveryDate(CommonUtil.StringToDate(importCustomizedOuPaiDTO.getDueDateStr())); trunklineAdvanceEntity.setCreateUserName(AuthUtil.getNickName()); advanceService.save(trunklineAdvanceEntity); + advanceEntityList.add(trunklineAdvanceEntity); }else{ Long advanceId = trunklineAdvanceEntity.getId(); orderPackageCodes = advanceDetailService.findOrderPackageCodesByAdvanceId(advanceId); } - for (ImportCustomizedOuPaiDTO customizedOuPaiDTO : paiDTOList) { String orderPackageCode = customizedOuPaiDTO.getOrderPackageCode(); if(orderPackageCodes.contains(orderPackageCode)){ @@ -1219,12 +1220,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService { log.info("################本次耗时 "+(end-start) + "ms"); - return R.success("导入成功"); + return R.data(advanceEntityList); } @Transactional(rollbackFor = Exception.class) @Override - public R importStandardOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { + public R> importStandardOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { if(Objects.isNull(file)){ log.warn("##################importStandardOuPai: 文件不存在"); return R.fail(405,"文件不存在"); @@ -1238,6 +1239,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Set set = listMap.keySet(); + List advanceEntityList = new ArrayList<>(); List advanceDetailEntities = new ArrayList<>(); for (String str : set) { List paiDTOList = listMap.get(str); @@ -1274,11 +1276,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService { trunklineAdvanceEntity.setDeliveryDate(CommonUtil.StringToDate(importStandardOuPaiDTO.getDueDateStr())); trunklineAdvanceEntity.setCreateUserName(AuthUtil.getNickName()); advanceService.save(trunklineAdvanceEntity); + advanceEntityList.add(trunklineAdvanceEntity); }else{ Long advanceId = trunklineAdvanceEntity.getId(); orderPackageCodes = advanceDetailService.findOrderPackageCodesByAdvanceId(advanceId); } + for (ImportStandardOuPaiDTO standardOuPaiDTO : paiDTOList) { String orderPackageCode = standardOuPaiDTO.getOrderPackageCode(); if(orderPackageCodes.contains(orderPackageCode)){ @@ -1376,7 +1380,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } advanceDetailService.saveBatch(advanceDetailEntities); - return R.success("导入成功"); + return R.data(advanceEntityList); } @Override @@ -1556,7 +1560,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } @Override - public R importOrderNoPackage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { + public R> importOrderNoPackage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException { if(Objects.isNull(file)){ log.warn("##################importOrderNoPackage: 文件不存在"); return R.fail(405,"文件不存在"); @@ -1597,7 +1601,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } advanceService.saveBatch(list); - return R.success("导入成功"); + return R.data(list); } @Override