Browse Source

修改市配零担备货查询

training
caoyizhong 1 year ago
parent
commit
4fcf0e43ba
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  2. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationZeroPackageService.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  4. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  5. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java
  6. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  7. 95
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

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

@ -319,7 +319,7 @@
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3' LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3'
<where> <where>
ldsi.stockup_id =#{id} ldsi.stockup_id =#{id} and ldpl.order_package_code is not null
</where> </where>
</select> </select>
<select id="getPageVOList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> <select id="getPageVOList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationZeroPackageService.java

@ -51,10 +51,12 @@ public interface IDistributionReservationZeroPackageService extends BaseService<
/** /**
* 根据包件ID查询预约数量 * 根据包件ID查询预约数量
*
* @param parcelListId * @param parcelListId
* @param reservationId
* @return * @return
*/ */
DistributionReservationZeroPackageEntity getOneZeroPackageNum(Long parcelListId); DistributionReservationZeroPackageEntity getOneZeroPackageNum(Long parcelListId,Long reservationId);
/** /**

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java

@ -68,6 +68,11 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
*/ */
Map<String,Object> selectHomeStockupPage(StockupDTO stockupDTO); Map<String,Object> selectHomeStockupPage(StockupDTO stockupDTO);
/**
* 查询货位信息
* @param stockupDTO
* @return
*/
List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO); List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO);
List<DistributionStockupStockListVO> selectStockupStockList(StockupDTO stockupDTO); List<DistributionStockupStockListVO> selectStockupStockList(StockupDTO stockupDTO);

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -903,6 +903,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
} }
}else{ }else{
//商,市 //商,市
//查询包件数据
List<DistributionReservationPackageEntity> packageEntities = distributionReservationPackageMapper.selectList(Wrappers.<DistributionReservationPackageEntity>query().lambda() List<DistributionReservationPackageEntity> packageEntities = distributionReservationPackageMapper.selectList(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, stockupDTO.getReservationId()) .eq(DistributionReservationPackageEntity::getReservationId, stockupDTO.getReservationId())
.eq(DistributionReservationPackageEntity::getPacketBarStatus, '1') .eq(DistributionReservationPackageEntity::getPacketBarStatus, '1')
@ -932,6 +933,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
stockupEntity.setFixTime(new Date()); stockupEntity.setFixTime(new Date());
} }
} }
if(s.get()){ if(s.get()){
stockupEntity.setStockupStatus(StockupStatusConstant.beihuozhong.getValue()); stockupEntity.setStockupStatus(StockupStatusConstant.beihuozhong.getValue());
}else{ }else{

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java

@ -16,6 +16,7 @@
*/ */
package com.logpm.distribution.service.impl; package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity; import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.distribution.vo.DistributionReservationZeroPackageVO; import com.logpm.distribution.vo.DistributionReservationZeroPackageVO;
@ -54,14 +55,17 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
/** /**
* 查询预约数量 * 查询预约数量
*
* @param parcelListId * @param parcelListId
* @param reservationId
* @return * @return
*/ */
@Override @Override
public DistributionReservationZeroPackageEntity getOneZeroPackageNum(Long parcelListId) { public DistributionReservationZeroPackageEntity getOneZeroPackageNum(Long parcelListId, Long reservationId) {
return baseMapper.selectOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() return baseMapper.selectOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getParcelListId, parcelListId) .eq(DistributionReservationZeroPackageEntity::getParcelListId, parcelListId)
.eq(DistributionReservationZeroPackageEntity::getIsDeleted, '0') .eq(DistributionReservationZeroPackageEntity::getIsDeleted, '0')
.eq(ObjectUtils.isNotNull(reservationId),DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.in(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "1", "3")); .in(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "1", "3"));
} }

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -460,7 +460,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionStockListEntity.setMallName(Optional.ofNullable(distributionStockArticleEntity.getMallName()).orElse(null)); //商场名称 distributionStockListEntity.setMallName(Optional.ofNullable(distributionStockArticleEntity.getMallName()).orElse(null)); //商场名称
distributionStockListEntity.setQuantityStock(Optional.ofNullable(distributionParcelList.getQuantity()).orElse(null)); //库存数量(包件数量) distributionStockListEntity.setQuantityStock(Optional.ofNullable(distributionParcelList.getQuantity()).orElse(null)); //库存数量(包件数量)
distributionStockListEntity.setIncomingBatch(Optional.ofNullable(distributionStockArticleEntity.getWaybillNumber()).orElse(null)); //入库批次 distributionStockListEntity.setIncomingBatch(Optional.ofNullable(distributionStockArticleEntity.getOrderCode()).orElse(null)); //入库批次
distributionStockListEntity.setOutboundQuantity(0); //出库数量 distributionStockListEntity.setOutboundQuantity(0); //出库数量
// distributionStockListEntity.setCargoUnit(Optional.ofNullable(distributionParcelList.getMaterialUnit()).orElse(null));//单位 // distributionStockListEntity.setCargoUnit(Optional.ofNullable(distributionParcelList.getMaterialUnit()).orElse(null));//单位
@ -481,7 +481,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量 distributionStockListEntity.setQuantityOccupied(0);//冻结数量
distributionStockListEntity.setServiceType(distributionStockArticleEntity.getTypeService());//冻结数量 distributionStockListEntity.setServiceType(distributionStockArticleEntity.getTypeService());//冻结数量
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelList.getMaterialId(), distributionStockArticleEntity.getWaybillNumber(),distributionStockArticleEntity.getStoreId(),distributionStockArticleEntity.getWarehouseId()); DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelList.getMaterialId(), distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getStoreId(),distributionStockArticleEntity.getWarehouseId());
if(ObjectUtils.isNotNull(stockListEntity)){ if(ObjectUtils.isNotNull(stockListEntity)){
//有记录 //有记录
DistributionStockListEntity listEntity = new DistributionStockListEntity(); DistributionStockListEntity listEntity = new DistributionStockListEntity();

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

@ -588,6 +588,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return t -> map.putIfAbsent(keyExtractor.apply(t),Boolean.TRUE)==null; return t -> map.putIfAbsent(keyExtractor.apply(t),Boolean.TRUE)==null;
} }
/**
* 查询货位包件信息
* @param stockupDTO
* @return
*/
@Override @Override
public List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO) { public List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO) {
Long reservationId = stockupDTO.getReservationId();//预约单id Long reservationId = stockupDTO.getReservationId();//预约单id
@ -604,9 +609,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity();
if(stockupDTO.getIsZero().equals("1")) { if(stockupDTO.getIsZero().equals("1")) {
//零担 查询预约数量 //零担 查询预约数量
one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId()); one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId(),stockupDTO.getReservationId());
} }
int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1; int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1;
int i2 = stockupDTO.getIsZero().equals("1") ? one.getRealityQuantity() : 1;
if(listYou.size() > 0){ if(listYou.size() > 0){
boolean b = listYou.stream().anyMatch(o -> o.getAllocationId().equals(i.getAllocationId())); boolean b = listYou.stream().anyMatch(o -> o.getAllocationId().equals(i.getAllocationId()));
if(b){ if(b){
@ -615,7 +621,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//相同 //相同
y.setPlanNum(y.getPlanNum()+i1); y.setPlanNum(y.getPlanNum()+i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
y.setScanNum(y.getScanNum()+i1); y.setScanNum(y.getScanNum()+i2);
} }
//t托盘信息 //t托盘信息
if(ObjectUtils.isNotNull(y.getTrayId()) && ObjectUtils.isNotNull(i.getTrayId()) && !y.getTrayId().equals(i.getTrayId())){ if(ObjectUtils.isNotNull(y.getTrayId()) && ObjectUtils.isNotNull(i.getTrayId()) && !y.getTrayId().equals(i.getTrayId())){
@ -634,7 +640,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}else{ }else{
i.setPlanNum(i1); i.setPlanNum(i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(i1); i.setScanNum(i2);
}else{ }else{
i.setScanNum(0); i.setScanNum(0);
} }
@ -644,7 +650,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}else{ }else{
i.setPlanNum(i1); i.setPlanNum(i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(i1); i.setScanNum(i2);
}else{ }else{
i.setScanNum(0); i.setScanNum(0);
} }
@ -675,9 +681,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity();
if(stockupDTO.getIsZero().equals("1")) { if(stockupDTO.getIsZero().equals("1")) {
//零担 查询预约数量 //零担 查询预约数量
one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId()); one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId(),stockupDTO.getReservationId() );
} }
int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1; int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1;
int i2 = stockupDTO.getIsZero().equals("1") ? one.getRealityQuantity() : 1;
boolean b = listYou.stream().anyMatch(ii ->ii.getAllocationId().equals(i.getAllocationId())); boolean b = listYou.stream().anyMatch(ii ->ii.getAllocationId().equals(i.getAllocationId()));
if(b){ if(b){
listYou.forEach( wu -> { listYou.forEach( wu -> {
@ -685,7 +692,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//相同 //相同
wu.setPlanNum(wu.getPlanNum()+i1); wu.setPlanNum(wu.getPlanNum()+i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
wu.setScanNum(wu.getScanNum()+i1); wu.setScanNum(wu.getScanNum()+i2);
} }
//托盘信息 //托盘信息
if(ObjectUtils.isNotNull(i.getTrayId()) && !wu.getTrayId().equals(i.getTrayId())){ if(ObjectUtils.isNotNull(i.getTrayId()) && !wu.getTrayId().equals(i.getTrayId())){
@ -709,7 +716,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}else{ }else{
i.setPlanNum( i1); i.setPlanNum( i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(i1); i.setScanNum(i2);
i.setCompleteStact(true); i.setCompleteStact(true);
}else{ }else{
i.setScanNum(0); i.setScanNum(0);
@ -722,9 +729,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity();
if(stockupDTO.getIsZero().equals("1")) { if(stockupDTO.getIsZero().equals("1")) {
//零担 查询预约数量 //零担 查询预约数量
one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId()); one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId(), stockupDTO.getReservationId());
} }
int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1; int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1;
int i2 = stockupDTO.getIsZero().equals("1") ? one.getRealityQuantity() : 1;
boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId())); boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId()));
if(b){ if(b){
@ -734,7 +742,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
wu.setPlanNum(wu.getPlanNum()+i1); wu.setPlanNum(wu.getPlanNum()+i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
wu.setScanNum(wu.getScanNum()+i1); wu.setScanNum(wu.getScanNum()+i2);
} }
//托盘信息 //托盘信息
if( ObjectUtils.isNotNull(i.getTrayId()) && !wu.getTrayId().equals(i.getTrayId())){ if( ObjectUtils.isNotNull(i.getTrayId()) && !wu.getTrayId().equals(i.getTrayId())){
@ -758,7 +766,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}else{ }else{
i.setPlanNum(i1); i.setPlanNum(i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(i1); i.setScanNum(i2);
i.setCompleteStact(true); i.setCompleteStact(true);
}else{ }else{
i.setScanNum(0); i.setScanNum(0);
@ -787,9 +795,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity();
if(stockupDTO.getIsZero().equals("1")) { if(stockupDTO.getIsZero().equals("1")) {
//零担 查询预约数量 //零担 查询预约数量
one = reservationZeroPackageService.getOneZeroPackageNum(p.getParcelListId()); one = reservationZeroPackageService.getOneZeroPackageNum(p.getParcelListId(),stockupDTO.getReservationId() );
} }
int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1; int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1;
int i2 = stockupDTO.getIsZero().equals("1") ? one.getRealityQuantity() : 1;
if(listYou.size() > 0){ if(listYou.size() > 0){
// //
@ -801,7 +810,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//相同 //相同
y.setPlanNum(y.getPlanNum()+i1); y.setPlanNum(y.getPlanNum()+i1);
if(ObjectUtils.isNotNull(p.getStockId())){ if(ObjectUtils.isNotNull(p.getStockId())){
y.setScanNum(y.getScanNum()+i1); y.setScanNum(y.getScanNum()+i2);
} }
//t托盘信息 //t托盘信息
if(ObjectUtils.isNotNull(y.getTrayId()) && !y.getTrayId().contains(p.getTrayId())){ if(ObjectUtils.isNotNull(y.getTrayId()) && !y.getTrayId().contains(p.getTrayId())){
@ -823,7 +832,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (ObjectUtils.isNull(p.getStockId())){ if (ObjectUtils.isNull(p.getStockId())){
p.setScanNum(0); p.setScanNum(0);
}else{ }else{
p.setScanNum(i1); p.setScanNum(i2);
} }
listYou.add(p); listYou.add(p);
} }
@ -833,7 +842,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (ObjectUtils.isNull(p.getStockId())){ if (ObjectUtils.isNull(p.getStockId())){
p.setScanNum(0); p.setScanNum(0);
}else{ }else{
p.setScanNum(i1); p.setScanNum(i2);
} }
listYou.add(p); listYou.add(p);
@ -860,9 +869,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity();
if(stockupDTO.getIsZero().equals("1")) { if(stockupDTO.getIsZero().equals("1")) {
//零担 查询预约数量 //零担 查询预约数量
one = reservationZeroPackageService.getOneZeroPackageNum(p.getParcelListId()); one = reservationZeroPackageService.getOneZeroPackageNum(p.getParcelListId(),stockupDTO.getReservationId() );
} }
int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1; int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1;
int i2 = stockupDTO.getIsZero().equals("1") ? one.getRealityQuantity() : 1;
if(listYou.size() > 0){ if(listYou.size() > 0){
@ -875,7 +885,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//相同 //相同
y.setPlanNum(y.getPlanNum()+i1); y.setPlanNum(y.getPlanNum()+i1);
if(ObjectUtils.isNotNull(p.getStockId())){ if(ObjectUtils.isNotNull(p.getStockId())){
y.setScanNum(y.getScanNum()+i1); y.setScanNum(y.getScanNum()+i2);
} }
//t托盘信息 //t托盘信息
if(ObjectUtils.isNotNull(y.getTrayId()) && ObjectUtils.isNotNull(p.getTrayId()) && !y.getTrayId().contains(p.getTrayId())){ if(ObjectUtils.isNotNull(y.getTrayId()) && ObjectUtils.isNotNull(p.getTrayId()) && !y.getTrayId().contains(p.getTrayId())){
@ -902,7 +912,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (ObjectUtils.isNull(p.getStockId())){ if (ObjectUtils.isNull(p.getStockId())){
p.setScanNum(0); p.setScanNum(0);
}else{ }else{
p.setScanNum(i1); p.setScanNum(i2);
p.setCompleteStact(true); p.setCompleteStact(true);
} }
listYou.add(p); listYou.add(p);
@ -913,7 +923,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (ObjectUtils.isNull(p.getStockId())){ if (ObjectUtils.isNull(p.getStockId())){
p.setScanNum(0); p.setScanNum(0);
}else{ }else{
p.setScanNum(i1); p.setScanNum(i2);
p.setCompleteStact(true); p.setCompleteStact(true);
} }
listYou.add(p); listYou.add(p);
@ -924,9 +934,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity one = new DistributionReservationZeroPackageEntity();
if(stockupDTO.getIsZero().equals("1")) { if(stockupDTO.getIsZero().equals("1")) {
//零担 查询预约数量 //零担 查询预约数量
one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId()); one = reservationZeroPackageService.getOneZeroPackageNum(i.getParcelListId(), stockupDTO.getReservationId());
} }
int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1; int i1 = stockupDTO.getIsZero().equals("1") ? one.getQuantity() : 1;
int i2 = stockupDTO.getIsZero().equals("1") ? one.getRealityQuantity() : 1;
boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId())); boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId()));
@ -936,7 +947,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//相同 //相同
wu.setPlanNum(wu.getPlanNum()+i1); wu.setPlanNum(wu.getPlanNum()+i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
wu.setScanNum(wu.getScanNum()+i1); wu.setScanNum(wu.getScanNum()+i2);
} }
//托盘信息 //托盘信息
if(ObjectUtils.isNotNull(wu.getTrayId()) && ObjectUtils.isNotNull(i.getTrayId()) && !wu.getTrayId().contains(i.getTrayId())){ if(ObjectUtils.isNotNull(wu.getTrayId()) && ObjectUtils.isNotNull(i.getTrayId()) && !wu.getTrayId().contains(i.getTrayId())){
@ -960,7 +971,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}else{ }else{
i.setPlanNum(i1); i.setPlanNum(i1);
if(ObjectUtils.isNotNull(i.getStockId())){ if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(i1); i.setScanNum(i2);
i.setCompleteStact(true); i.setCompleteStact(true);
}else{ }else{
i.setScanNum(0); i.setScanNum(0);
@ -2123,7 +2134,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
stockupDTO.setStockArticleId(null); stockupDTO.setStockArticleId(null);
} }
//把数据取出来 //把数据取出来
List<StockupZeroVO> zeroStockUpData = new ArrayList<>();; List<StockupZeroVO> zeroStockUpData;;
if(stockupDTO.getTypeService().equals("3")){ if(stockupDTO.getTypeService().equals("3")){
//自提 //自提
if(ObjectUtils.isNull(stockupDTO.getAllocationId())){ if(ObjectUtils.isNull(stockupDTO.getAllocationId())){
@ -2146,9 +2157,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} }
} }
List<StockupZeroVO> finalZeroStockUpData = zeroStockUpData; int xiugai= 0;
List<StockupZeroVO> collect = stockupDTO.getList().stream().filter( //可以 List<StockupZeroVO> collect = zeroStockUpData.stream().filter( //可以
a -> finalZeroStockUpData.stream().anyMatch(q -> a.getStockArticleId().equals(q.getStockArticleId()) && a.getQuantity() <= q.getQuantity() && a.getQuantity() > 0) a -> stockupDTO.getList().stream().anyMatch(q -> a.getStockArticleId().equals(q.getStockArticleId()) && q.getQuantity() <= a.getQuantity() && q.getQuantity() > 0)
).collect(Collectors.toList()); ).collect(Collectors.toList());
//添加备货信息 //添加备货信息
List<DistributionStockEntity> stockEntityList = new ArrayList<>(); List<DistributionStockEntity> stockEntityList = new ArrayList<>();
@ -2157,11 +2168,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionStockEntity one = distributionStockService.getOne(Wrappers.<DistributionStockEntity>query().lambda() DistributionStockEntity one = distributionStockService.getOne(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getStockArticle, i.getStockArticleId()) .eq(DistributionStockEntity::getStockArticle, i.getStockArticleId())
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId()) .eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId())
.eq(DistributionStockEntity::getReservationId, stockupDTO.getReservationId())
.eq(DistributionStockEntity::getParcelListId, i.getParcelListId()) .eq(DistributionStockEntity::getParcelListId, i.getParcelListId())
); );
//查询备货数量 //查询备货数量
DistributionReservationZeroPackageEntity byId = reservationZeroPackageService.getById(i.getId()); DistributionReservationZeroPackageEntity byId = reservationZeroPackageService.getById(i.getId());
if(byId.getRealityQuantity()+i.getQuantity() > byId.getQuantity()){ if(i.getQuantity() > byId.getQuantity()){
return Resp.scanFail(i.getCategoryName()+"备货数量大于待备货数量!",i.getCategoryName()+"备货数量大于待备货数量!"); return Resp.scanFail(i.getCategoryName()+"备货数量大于待备货数量!",i.getCategoryName()+"备货数量大于待备货数量!");
} }
@ -2169,7 +2181,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//修改数量 //修改数量
DistributionStockEntity stockEntity = new DistributionStockEntity(); DistributionStockEntity stockEntity = new DistributionStockEntity();
stockEntity.setId(one.getId()); stockEntity.setId(one.getId());
stockEntity.setStockQuantity(one.getStockQuantity()+i.getQuantity()); stockEntity.setStockQuantity(i.getQuantity());
distributionStockService.updateById(stockEntity); distributionStockService.updateById(stockEntity);
}else{ }else{
DistributionStockEntity stockEntity = new DistributionStockEntity(); DistributionStockEntity stockEntity = new DistributionStockEntity();
@ -2192,17 +2204,30 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionReservationZeroPackageEntity reservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity reservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
reservationZeroPackageEntity.setRealityQuantity(i.getQuantity()); reservationZeroPackageEntity.setRealityQuantity(i.getQuantity());
reservationZeroPackageEntity.setId(i.getId()); reservationZeroPackageEntity.setId(i.getId());
reservationZeroPackageService.updateById(reservationZeroPackageEntity); boolean b = reservationZeroPackageService.updateById(reservationZeroPackageEntity);
if(!b){
return Resp.scanFail("修改失败!!","修改失败!!");
}else{
xiugai += 1;
}
} }
boolean b = distributionStockService.saveBatch(stockEntityList); if(!stockEntityList.isEmpty()){
if(b){ boolean b = distributionStockService.saveBatch(stockEntityList);
//修改备货状态 if(b){
distributionAsyncService.stockZero(stockupDTO); //修改备货状态
return R.success("备货成功!"); distributionAsyncService.stockZero(stockupDTO);
return Resp.scanSuccess("备货成功!","备货成功!");
}else{
//
return Resp.scanFail("修改失败!!","修改失败!!");
}
}else{ }else{
// if(collect.size() == xiugai){
return R.fail(3004,"修改失败!!"); return Resp.scanSuccess("备货成功!","备货成功!");
}
return Resp.scanFail("备货失败!","备货失败!");
} }
} }
/** /**

Loading…
Cancel
Save