Browse Source

修改系统备货数量不增加

single_db
caoyizhong 1 year ago
parent
commit
ce364820dc
  1. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  2. 49
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

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

@ -51,6 +51,12 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
*/ */
List<DistributionStockupVO> selectDistributionStockupPage(IPage page, DistributionStockupVO distributionStockup); List<DistributionStockupVO> selectDistributionStockupPage(IPage page, DistributionStockupVO distributionStockup);
/**
* 查询备货数据
* @param page
* @param distributionStockupEntity
* @return
*/
IPage<DistributionStockupEntity> pageList(IPage<Object> page,@Param("param") DistributionStockupEntity distributionStockupEntity); IPage<DistributionStockupEntity> pageList(IPage<Object> page,@Param("param") DistributionStockupEntity distributionStockupEntity);
IPage<DistributionStockupListVO> selectStockupPage(IPage<Object> page, @Param("param") StockupDTO stockupDTO); IPage<DistributionStockupListVO> selectStockupPage(IPage<Object> page, @Param("param") StockupDTO stockupDTO);

49
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

@ -42,10 +42,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/** /**
* 库存品详情信息 服务实现类 * 库存品详情信息 服务实现类
@ -206,6 +203,7 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
// DistributionStockDTO distributionStock1 = JSONObject.parseObject(JSONObject.toJSONString(distributionStocks), DistributionStockDTO.class); // DistributionStockDTO distributionStock1 = JSONObject.parseObject(JSONObject.toJSONString(distributionStocks), DistributionStockDTO.class);
List<String> ids = distributionStocks.getIds(); List<String> ids = distributionStocks.getIds();
List<DistributionStockEntity> list = new ArrayList<>(); List<DistributionStockEntity> list = new ArrayList<>();
for (int ii = 0; ii < ids.size(); ii++) { for (int ii = 0; ii < ids.size(); ii++) {
String i = ids.get(ii); String i = ids.get(ii);
DistributionStockEntity stockEntity = new DistributionStockEntity(); DistributionStockEntity stockEntity = new DistributionStockEntity();
@ -258,6 +256,38 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
parcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue()); parcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
distributionParcelListService.updateById(parcelListEntity); distributionParcelListService.updateById(parcelListEntity);
// distributionStockService.list(Wrappers.<S>query().lambda().eq()); // distributionStockService.list(Wrappers.<S>query().lambda().eq());
//添加备货数据
if(ObjectUtils.isNotNull(distributionStocks.getStockupType()) && distributionStocks.getStockupType().equals("ZT")){
//自提
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingMapper.selectById(stockEntity.getBillLadingId());
if(ObjectUtils.isNotNull(billLadingEntity)){
DistrilbutionBillLadingEntity billLading = new DistrilbutionBillLadingEntity();
billLading.setId(billLadingEntity.getId());
billLading.setStockOrderQuantity(billLadingEntity.getStockOrderQuantity()+1);
distrilbutionBillLadingMapper.updateById(billLading);
}
}else{
//商 市
DistributionReservationEntity byId2 = distributionReservationService.getById(stockEntity.getReservationId());
if(ObjectUtils.isNotNull(byId2)){
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
reservationEntity.setId(byId2.getId());
int yu =byId2.getReservationNum() + byId2.getReservationStockListNum();
int bei = byId2.getStockOrderQuantity()+1 + byId2.getReserveQuantity();
if(bei >= yu){
reservationEntity.setStockOrderQuantity(byId2.getStockOrderQuantity()+1);
reservationEntity.setStockStatus("3");
reservationEntity.setEndTimeStocking(new Date());
}else{
reservationEntity.setStockOrderQuantity(byId2.getStockOrderQuantity()+1);
reservationEntity.setStockStatus("2");
if(ObjectUtils.isNull(reservationEntity.getStartTimeStocking())){
reservationEntity.setStartTimeStocking(new Date());
}
}
distributionReservationService.updateById(reservationEntity);
}
}
} }
if(ObjectUtils.isNotNull(distributionStocks.getStockupType()) && distributionStocks.getStockupType().equals("ZT")){ if(ObjectUtils.isNotNull(distributionStocks.getStockupType()) && distributionStocks.getStockupType().equals("ZT")){
//修改备货状态 自提 //修改备货状态 自提
@ -279,6 +309,7 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
* @param type * @param type
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void getUpdateOrderState(Long pageId,int type,Integer num ) { public void getUpdateOrderState(Long pageId,int type,Integer num ) {
switch (type){ switch (type){
case 1: //修改订单备货状态 case 1: //修改订单备货状态
@ -298,7 +329,6 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
case 2: //备货 商 市 case 2: //备货 商 市
//查询还没有扫的数量 //查询还没有扫的数量
DistributionStockVO distributionStockVO1 = baseMapper.selectStockupInfo(pageId); DistributionStockVO distributionStockVO1 = baseMapper.selectStockupInfo(pageId);
if(ObjectUtils.isNotNull(distributionStockVO1)){ if(ObjectUtils.isNotNull(distributionStockVO1)){
//有订单 //有订单
if(ObjectUtils.isNotNull(distributionStockVO1.getScanned()) && !distributionStockVO1.getScanned().equals(0)){ if(ObjectUtils.isNotNull(distributionStockVO1.getScanned()) && !distributionStockVO1.getScanned().equals(0)){
@ -324,6 +354,9 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
break; break;
case 3://自提 case 3://自提
DistributionStockupInfoEntity one = distributionStockupInfoService.getOne(Wrappers.<DistributionStockupInfoEntity>query().lambda()
.eq(DistributionStockupInfoEntity::getStockupId, pageId)
);
DistributionStockVO distributionStockSelf = baseMapper.selectStockupInfoSelf(pageId); DistributionStockVO distributionStockSelf = baseMapper.selectStockupInfoSelf(pageId);
//查询库存品 //查询库存品
DistributionDeliveryDetailsVO distributionSelf = distributionDeliveryDetailsService.selectCount(pageId); DistributionDeliveryDetailsVO distributionSelf = distributionDeliveryDetailsService.selectCount(pageId);
@ -349,6 +382,12 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
if(ys + num >= qb){ if(ys + num >= qb){
//修改备货任务 //修改备货任务
getUpdateStockup(pageId,2); getUpdateStockup(pageId,2);
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingMapper.selectById(one.getReservationId());
DistrilbutionBillLadingEntity billLading = new DistrilbutionBillLadingEntity();
billLading.setId(billLadingEntity.getId());
billLading.setStockStatus("3");
billLading.setEndTimeStocking(new Date());
distrilbutionBillLadingMapper.updateById(billLading);
}else{ }else{
//没有完成 //没有完成
getUpdateStockup(pageId,1); getUpdateStockup(pageId,1);

Loading…
Cancel
Save