Browse Source

1.导入数据补录无数据装车数据

pull/33/head
zhenghaoyu 12 months ago
parent
commit
def52d3628
  1. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java
  2. 43
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  3. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  4. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  5. 26
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

3
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;
}

43
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<List<TrunklineAdvanceEntity>> listR = openOrderService.openLabelHasPacakage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file);
List<TrunklineAdvanceEntity> 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<List<TrunklineAdvanceEntity>> listR = openOrderService.importOrderNoPackage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file);
// List<TrunklineAdvanceEntity> 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<List<TrunklineAdvanceEntity>> listR = openOrderService.importCustomizedOuPai(myCurrentWarehouse.getId(), myCurrentWarehouse.getName(), file);
List<TrunklineAdvanceEntity> 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<List<TrunklineAdvanceEntity>> listR = openOrderService.importStandardOuPai(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file);
List<TrunklineAdvanceEntity> 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);

2
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

9
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<List<TrunklineAdvanceEntity>> openLabelHasPacakage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R importCustomizedOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R<List<TrunklineAdvanceEntity>> importCustomizedOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R importStandardOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R<List<TrunklineAdvanceEntity>> 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<List<TrunklineAdvanceEntity>> importOrderNoPackage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R checkWaybill(OpenOrderDTO openOrderDTO);

26
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<List<TrunklineAdvanceEntity>> 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<String> set = listMap.keySet();
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = new ArrayList<>();
List<TrunklineAdvanceEntity> advanceEntityList = new ArrayList<>();
for (String str : set) {
List<PacakgeDetailExcelDTO> 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<List<TrunklineAdvanceEntity>> 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<String> set = listMap.keySet();
List<TrunklineAdvanceEntity> advanceEntityList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = new ArrayList<>();
for (String str : set) {
List<ImportCustomizedOuPaiDTO> 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<List<TrunklineAdvanceEntity>> 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<String> set = listMap.keySet();
List<TrunklineAdvanceEntity> advanceEntityList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = new ArrayList<>();
for (String str : set) {
List<ImportStandardOuPaiDTO> 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<List<TrunklineAdvanceEntity>> 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

Loading…
Cancel
Save