Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fix-sign
zhaoqiaobo 4 months ago
parent
commit
974233f12a
  1. 10
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/dto/BasicdataTripartiteMallFeignDTO.java
  2. 7
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTripartiteMallClient.java
  3. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java
  4. 55
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTripartiteMallClient.java
  5. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTripartiteMallMapper.java
  6. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTripartiteMallService.java
  7. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java
  9. 53
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  10. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  11. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java
  12. 76
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

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

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

2
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;

55
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<BasicdataTripartiteMallEntity> top(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<BasicdataTripartiteMallEntity> page = basicdataTripartiteMallService.page(Condition.getPage(query));
return BladePage.of(page);
}
@Override
@GetMapping(TOP)
public BladePage<BasicdataTripartiteMallEntity> top(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<BasicdataTripartiteMallEntity> 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<BasicdataTripartiteMallEntity> 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<BasicdataTripartiteMallEntity> list = basicdataTripartiteMallService.list(queryWrapper);
if(CollUtil.isEmpty(list)){
if (CollUtil.isEmpty(list)) {
return null;
}else{
} else {
return list.get(0);
}
}

1
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;

1
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;

2
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;

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java

@ -152,7 +152,7 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
public void signFor(NodeFanoutMsg<DistributionSignforVO> nodeFanoutMsg, BladeUser user) {
try {
if (nodeFanoutMsg == null) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> nodeFanoutMsg is null! ");
log.warn(">>>>>>>>>>>>>>>>>>>>>>>>>> nodeFanoutMsg is null! ");
return;
}
if (distributionProperties.getSendFanoutMsg()) {

53
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<DistributionParcelListEntity> 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<DistributionParcelListEntity> 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<TrunklineAdvanceDetailEntity> detailList = advanceDetailService.list(queryWrapper);
List<String> orderPackageCodes = advanceService.incomingPackageBatch(advanceId, warehouseId, detailList, userId, deptId, tenantId, waybillEntity,incomingType);
List<String> 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();

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -9103,12 +9103,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (Objects.nonNull(finalNodeWarehouse)) {
finalNodeName = finalNodeWarehouse.getName();
}
Map<Long, DistributionStockArticleEntity> stockArticleMap = new HashMap<>();
List<DistributionParcelListEntity> entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, "20", waybillNo);
//把entityListByOrderCode中所有stockArticleId放入一个Set集合
Set<Long> stockArticleIdSet = entityListByOrderCode.stream().map(DistributionParcelListEntity::getStockArticleId).collect(Collectors.toSet());
List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleClient.findStockListByIds(new ArrayList<>(stockArticleIdSet));
//把stockArticleEntityList中所有元素转化成以id为key的Map
Map<Long, DistributionStockArticleEntity> stockArticleMap = stockArticleEntityList.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getId, e1 -> e1));
if(!stockArticleIdSet.isEmpty()){
List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleClient.findStockListByIds(new ArrayList<>(stockArticleIdSet));
//把stockArticleEntityList中所有元素转化成以id为key的Map
stockArticleMap = stockArticleEntityList.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getId, e1 -> e1));
}
int size = entityListByOrderCode.size();
if (planNum.equals(size + realNum)) {

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java

@ -127,6 +127,8 @@ public class WarehouseWarehousingEntryController extends BladeController {
if(receiptDateStart != null && receiptDateStartEnd != null){
queryWrapper.lambda().between(WarehouseWarehousingEntryEntity::getReceiptDate, receiptDateStart+" 00:00:00", receiptDateStartEnd+" 23:59:59");
}
queryWrapper.orderByDesc("id");
IPage<WarehouseWarehousingEntryEntity> pages = warehouseWarehousingEntryService.page(Condition.getPage(query), queryWrapper);
return R.data(pages);
}

76
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -4243,25 +4243,29 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if ("1".equals(associationType)) {
//把warehouseTrayGoodsEntities中所有的associationId放入一个Set
Set<Long> orderIdSet = warehouseTrayGoodsEntities.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toSet());
List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleClient.findStockListByIds(new ArrayList<>(orderIdSet));
stockArticleEntityList.forEach(stockArticleEntity -> {
String trays = stockArticleEntity.getTrays();
if (!StringUtil.isBlank(trays)) {
if (trays.contains(palletName)) {
List<String> list = Arrays.asList(trays.split(trays));
List<String> trayList = new ArrayList<>(list);
trayList.remove(palletName);
if (CollUtil.isNotEmpty(trayList)) {
DistributionStockArticleEntity updateStockArticle = new DistributionStockArticleEntity();
updateStockArticle.setId(stockArticleEntity.getId());
updateStockArticle.setTrays(StringUtil.join(trayList.toArray(), ","));
updateStockArticleList.add(updateStockArticle);
} else {
clearStockArticleIdList.add(stockArticleEntity.getId());
if(CollUtil.isNotEmpty(orderIdSet)){
List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleClient.findStockListByIds(new ArrayList<>(orderIdSet));
stockArticleEntityList.forEach(stockArticleEntity -> {
String trays = stockArticleEntity.getTrays();
if (!StringUtil.isBlank(trays)) {
if (trays.contains(palletName)) {
List<String> list = Arrays.asList(trays.split(trays));
List<String> trayList = new ArrayList<>(list);
trayList.remove(palletName);
if (CollUtil.isNotEmpty(trayList)) {
DistributionStockArticleEntity updateStockArticle = new DistributionStockArticleEntity();
updateStockArticle.setId(stockArticleEntity.getId());
updateStockArticle.setTrays(StringUtil.join(trayList.toArray(), ","));
updateStockArticleList.add(updateStockArticle);
} else {
clearStockArticleIdList.add(stockArticleEntity.getId());
}
}
}
}
});
});
}
} else if ("3".equals(associationType)) {
//把trayGoodsEntities中的所有元素的associationId放入一个List
@ -4274,25 +4278,29 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
List<DistributionParcelListEntity> oldParceList = distributionParcelListClient.findListByIds(orderPackageIdList);
//把oldParceList中的所有元素的stockArticleId放入一个set
Set<Long> stockArticleIdSet = oldParceList.stream().map(DistributionParcelListEntity::getStockArticleId).collect(Collectors.toSet());
List<DistributionStockArticleEntity> oldStockArticleList = distributionStockArticleClient.findStockListByIds(new ArrayList<>(stockArticleIdSet));
oldStockArticleList.forEach(stockArticleEntity -> {
String trays = stockArticleEntity.getTrays();
if (!StringUtil.isBlank(trays)) {
if (trays.contains(palletName)) {
List<String> list = Arrays.asList(trays.split(trays));
List<String> trayList = new ArrayList<>(list);
trayList.remove(palletName);
if (CollUtil.isNotEmpty(trayList)) {
DistributionStockArticleEntity updateStockArticle = new DistributionStockArticleEntity();
updateStockArticle.setId(stockArticleEntity.getId());
updateStockArticle.setTrays(StringUtil.join(trayList.toArray(), ","));
updateStockArticleList.add(updateStockArticle);
} else {
clearStockArticleIdList.add(stockArticleEntity.getId());
if(CollUtil.isNotEmpty(stockArticleIdSet)){
List<DistributionStockArticleEntity> oldStockArticleList = distributionStockArticleClient.findStockListByIds(new ArrayList<>(stockArticleIdSet));
oldStockArticleList.forEach(stockArticleEntity -> {
String trays = stockArticleEntity.getTrays();
if (!StringUtil.isBlank(trays)) {
if (trays.contains(palletName)) {
List<String> list = Arrays.asList(trays.split(trays));
List<String> trayList = new ArrayList<>(list);
trayList.remove(palletName);
if (CollUtil.isNotEmpty(trayList)) {
DistributionStockArticleEntity updateStockArticle = new DistributionStockArticleEntity();
updateStockArticle.setId(stockArticleEntity.getId());
updateStockArticle.setTrays(StringUtil.join(trayList.toArray(), ","));
updateStockArticleList.add(updateStockArticle);
} else {
clearStockArticleIdList.add(stockArticleEntity.getId());
}
}
}
}
});
});
}
}
});

Loading…
Cancel
Save