Browse Source

修改备货报错

master
pref_mail@163.com 11 months ago
parent
commit
bdb901a569
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupListVO.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  3. 68
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupListVO.java

@ -8,7 +8,7 @@ import java.io.Serializable;
public class DistributionStockupListVO implements Serializable {
private Long id;//预约单id
private Long reservationId;//预约单id(自提Id)
private String reservationId;//预约单id(自提Id)
private String reservation;//预约单id
private Integer typeService;//服务类型

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -815,7 +815,7 @@
</select>
<select id="selectStockupPageInfo" resultType="com.logpm.distribution.vo.DistributionStockupListVO">
select GROUP_CONCAT(ldsi.reservation_id SEPARATOR ',') reservationId, lds.stockup_code
select GROUP_CONCAT(ldsi.reservation_id SEPARATOR ',') reservation, lds.stockup_code
stockupCode,lds.type_service typeService,
lds.stockup_status stockupStatus,lds.stockup_area stockupArea
from logpm_distribution_stockup lds

68
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -398,13 +398,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
map.put("typeServiceStr", vo.getTypeServiceStr());
map.put("typeService", vo.getTypeService());
map.put("stockupArea", vo.getStockupArea());
map.put("reservationId", vo.getReservationId());
map.put("reservation", vo.getReservationId());
map.put("reservationId", vo.getReservationId());
map.put("stockupStatusStr", vo.getStockupStatusStr());
//查询客户数据
if (vo.getTypeService().equals(3)) {
//自
String[] split = vo.getReservation().split(",");
List<DistributionStockupListVO> list = baseMapper.selectStockupClientInfoSelf(stockupDTO);
list.forEach(i -> {
QueryWrapper<DistributionReservationZeroPackageEntity> queryWrapper = new QueryWrapper<>();
//查询有没有零担数据
@ -419,8 +424,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
i.setPlanNum(0);
}
//没有
List<DistributionStockPackageVO> list2 = distrilbutionBillStockService.listPackageSelf(i.getReservationId());
i.setPlanNum(i.getPlanNum() + list2.size());
for (String s : split) {
List<DistributionStockPackageVO> list2 = distrilbutionBillStockService.listPackageSelf(Long.parseLong(s));
i.setPlanNum(i.getPlanNum() + list2.size());
}
List<DistributionStockEntity> listStock = distributionStockService.list(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getBillLadingId, i.getReservationId())
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId())
@ -432,7 +439,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
i.setStockupNum(0);
}
});
map.put("orderList", list);
} else {
//商 ,市
@ -464,7 +474,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
queryWrapper.in("zero_package_status", "1", "3");
List<DistributionReservationZeroPackageEntity> list1 = reservationZeroPackageService.list(queryWrapper);
intToStrDistributionStockupListVO(distributionStockupListVO);
distributionStockupListVO.setReservationId(Long.parseLong(split[i]));
distributionStockupListVO.setReservationId(stockupDTO.getReservationId() + "");
distributionStockupListVO.setPlanNum(distributionStockupListVO.getPlanNum() + list1.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum());
List<DistributionStockEntity> list2 = distributionStockService.list(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getReservationId, stockupDTO.getReservationId())
@ -1839,8 +1849,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
public R addPackTrayList(StockupDTO stockupDTO) {
AtomicReference<Boolean> stock = new AtomicReference<>(false);
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse.getId())){
return Resp.scanFail("未授权!!!","未授权");
if (Func.isEmpty(myCurrentWarehouse.getId())) {
return Resp.scanFail("未授权!!!", "未授权");
}
DistributionStockupInfoEntity one = distributionStockupInfoService.getOne(Wrappers.<DistributionStockupInfoEntity>query().lambda()
@ -1999,11 +2009,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
distributionStockService.saveBatch(list1);
//备货库位上架
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())){
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("code", stockupDTO.getTrayBarCode());
jsonObject.put("stockUpAllocationId", stockupDTO.getStockupAllocationId());
jsonObject.put("stockUpAllocationId", stockupDTO.getStockupAllocationId());
jsonObject.put("type", 4);
jsonObject.put("num", list1.size());
warehouseUpdownStockUpAreaClient.upStockUpShelf(jsonObject);
@ -2524,8 +2534,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (ObjectUtils.isNull(stockupDTO.getNum())) {
log.error(method + "零担备货参数缺失Num", stockupDTO);
return Resp.scanFail("请输入备货数量 !", "请输入备货数量 !");
}else {
if (stockupDTO.getNum()<=0){
} else {
if (stockupDTO.getNum() <= 0) {
return Resp.scanFail("请输入正确备货数量 !", "请输入正确备货数量 !");
}
}
@ -2592,7 +2602,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId())
.eq(DistributionStockEntity::getStockArticle, stockupDTO.getStockArticleId())
);
if (!stockEntityList.isEmpty()){
if (!stockEntityList.isEmpty()) {
stockupNum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum();
}
}
@ -2613,7 +2623,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
stockEntity.setBillLadingId(stockupDTO.getReservationId());
stockEntity.setOutboundType("3");
} else {
stockEntity.setOutboundType(reservationEntity.getDeliveryType());
stockEntity.setOutboundType(reservationEntity.getDeliveryType());
}
stockEntity.setType(3);
stockEntity.setStockQuantity(stockupDTO.getNum());
@ -2669,7 +2679,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (trayList.size() == 1) {
//托盘解托
WarehouseTrayGoodsEntity trayGoodsEntity = trayList.get(0);
log.info(method+"downZeroTrayById>>>>>>>>>>>>>>>trayId:{},orderId:{},warehouseId:{},num:{}",trayGoodsEntity.getTrayId(),stockArticleEntity.getId(), myCurrentWarehouse.getId(), stockupDTO.getNum());
log.info(method + "downZeroTrayById>>>>>>>>>>>>>>>trayId:{},orderId:{},warehouseId:{},num:{}", trayGoodsEntity.getTrayId(), stockArticleEntity.getId(), myCurrentWarehouse.getId(), stockupDTO.getNum());
List<JSONObject> list = new ArrayList<>();
JSONObject jsonObject = new JSONObject();
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
@ -2692,7 +2702,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} else {
log.info(method + "无库位无托盘备货");
}
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())){
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("code", stockArticleEntity.getOrderCode());
@ -3216,9 +3226,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
);//预约信息
if (!list.isEmpty()) {
DistributionStockArticleEntity byId = distributionStockArticleService.getById(list.get(0).getStockArticleId());
if (!Func.isEmpty(byId)){
if (!Func.isEmpty(byId)) {
BasicdataClientEntity byName = basicdataClientClient.findByName(byId.getMallName());
if (!Func.isEmpty(byName)){
if (!Func.isEmpty(byName)) {
mallId = byId.getMallId();
mallName = byId.getMallName();
}
@ -3226,7 +3236,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
if (Objects.isNull(mallId) || Objects.isNull(mallName)){
if (Objects.isNull(mallId) || Objects.isNull(mallName)) {
List<DistributionDeliveryDetailsEntity> detailsEntities = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, reservationId)
.ne(DistributionDeliveryDetailsEntity::getInventoryStatus, "2")
@ -3234,17 +3244,17 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (!detailsEntities.isEmpty()) {
List<Long> ids = detailsEntities.stream().map(DistributionDeliveryDetailsEntity::getStockListId).distinct().collect(Collectors.toList());
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(ids);
if (!distributionStockListEntities.isEmpty()){
if (!distributionStockListEntities.isEmpty()) {
if (distributionStockListEntities.stream().map(DistributionStockListEntity::getMarketId).distinct().collect(Collectors.toList()).size() == 1 && distributionStockListEntities.stream().map(DistributionStockListEntity::getMallName).distinct().collect(Collectors.toList()).size() == 1) {
mallId = distributionStockListEntities.stream().map(DistributionStockListEntity::getMarketId).distinct().collect(Collectors.toList()).get(0);
mallName = distributionStockListEntities.stream().map(DistributionStockListEntity::getMarketName).distinct().collect(Collectors.toList()).get(0);
}else {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>自提单错误库存品计划,多个商场信息reservationId:{}",reservationId);
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>自提单错误库存品计划,多个商场信息商场ID:{}",distributionStockListEntities.stream().map(DistributionStockListEntity::getMarketId).distinct().collect(Collectors.toList()));
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>自提单错误库存品计划,多个商场信息商场名称:{}",distributionStockListEntities.stream().map(DistributionStockListEntity::getMarketName).distinct().collect(Collectors.toList()));
} else {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>自提单错误库存品计划,多个商场信息reservationId:{}", reservationId);
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>自提单错误库存品计划,多个商场信息商场ID:{}", distributionStockListEntities.stream().map(DistributionStockListEntity::getMarketId).distinct().collect(Collectors.toList()));
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>自提单错误库存品计划,多个商场信息商场名称:{}", distributionStockListEntities.stream().map(DistributionStockListEntity::getMarketName).distinct().collect(Collectors.toList()));
}
}else {
log.info(">>>>>>>>>>>>>>>>自提单无定制品和库存品 无效字体计划billLadingId:{}",reservationId);
} else {
log.info(">>>>>>>>>>>>>>>>自提单无定制品和库存品 无效字体计划billLadingId:{}", reservationId);
}
}
}
@ -3253,14 +3263,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} else {
// 查询预约单上的商城
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId);
if (!Func.isEmpty(distributionReservationEntity)){
if (!Func.isEmpty(distributionReservationEntity)) {
BasicdataClientEntity byName = basicdataClientClient.findByName(distributionReservationEntity.getMallName());
if (!Func.isEmpty(byName)){
if (!Func.isEmpty(byName)) {
mallId = distributionReservationEntity.getMallId();
mallName = distributionReservationEntity.getMallName();
}
}else {
log.info("查询预约单客户信息失败reservationId:{}",reservationId);
} else {
log.info("查询预约单客户信息失败reservationId:{}", reservationId);
}
}
@ -3374,7 +3384,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//过滤出同物料库存品的ID信息
List<Long> stockListIds = distributionStockListEntities.stream().map(DistributionStockListEntity::getId).collect(Collectors.toList());
if (stockListIds.isEmpty()) {
log.info("###################仓库查询物料信息错误物料编号:{},warehouseId:{}", stockupDTO.getCargoNumber(),myCurrentWarehouse.getId());
log.info("###################仓库查询物料信息错误物料编号:{},warehouseId:{}", stockupDTO.getCargoNumber(), myCurrentWarehouse.getId());
return null;
}

Loading…
Cancel
Save