Browse Source

修改备货查询

training
caoyizhong 1 year ago
parent
commit
da6f30852c
  1. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  2. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelNumberController.java
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  4. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  5. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  7. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  8. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java
  9. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

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

@ -460,11 +460,11 @@ public class DistributionStockupAppController extends BladeController {
log.warn("############备货库存品ID为空:{}",stockupDTO.getDeliveryDetailsId()); log.warn("############备货库存品ID为空:{}",stockupDTO.getDeliveryDetailsId());
return R.fail(3002, "备货库存品ID不能为空"); return R.fail(3002, "备货库存品ID不能为空");
} }
List<DistributionStockupTrayVO> list = distributionStockupService.getLocationSelection(stockupDTO); List<DistributionStockupTrayVO> list = distributionStockupService.getLocationSelection(stockupDTO); //自提
if(!list.isEmpty() && ObjectUtils.isNotNull(list.get(0))){ if(!list.isEmpty() && ObjectUtils.isNotNull(list.get(0))){
return R.data(list); return R.data(list);
} }
List<DistributionStockupTrayVO> listMarket = distributionStockupService.getLocationMarketSelection(stockupDTO); List<DistributionStockupTrayVO> listMarket = distributionStockupService.getLocationMarketSelection(stockupDTO); //商配
if(!listMarket.isEmpty() && ObjectUtils.isNotNull(listMarket.get(0))){ if(!listMarket.isEmpty() && ObjectUtils.isNotNull(listMarket.get(0))){
return R.data(listMarket); return R.data(listMarket);
} }

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

@ -114,11 +114,11 @@ public class DistributionParcelNumberController extends BladeController {
} }
/** /**
* 零担订单录入在库数量 * 零担订单修改录入在库数量
*/ */
@PostMapping("/updateEntryNum") @PostMapping("/updateEntryNum")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入distributionParcelNumber") @ApiOperation(value = "修改", notes = "传入distributionParcelNumber")
public R updateEntryNum(@Valid @RequestBody List<DistributionParcelNumberDTO> distributionParcelNumberDTO) { public R updateEntryNum(@Valid @RequestBody List<DistributionParcelNumberDTO> distributionParcelNumberDTO) {
return distributionParcelNumberService.updateEntryNum(distributionParcelNumberDTO); return distributionParcelNumberService.updateEntryNum(distributionParcelNumberDTO);
} }

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

@ -174,7 +174,7 @@
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id
<where> <where>
ldpl.conditions = '1'
<if test="param.allocationId != null and param.allocationId != ''"> and lds.allocation_id = #{param.allocationId} </if> <if test="param.allocationId != null and param.allocationId != ''"> and lds.allocation_id = #{param.allocationId} </if>
<if test="param.stockArticleId != null and param.stockArticleId != ''"> and ldpl.stock_article_id = #{param.stockArticleId} </if> <if test="param.stockArticleId != null and param.stockArticleId != ''"> and ldpl.stock_article_id = #{param.stockArticleId} </if>
<if test="param.stockArticleIdList != null "> <if test="param.stockArticleIdList != null ">
@ -227,7 +227,7 @@
LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id =ldpl.stock_article_id LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id =ldpl.stock_article_id
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
<where> <where>
ldsi.stockup_id = #{id} ldsi.stockup_id = #{id} and ldpl.conditions = '1' and ldpl.order_package_code is not null
</where> </where>
</select> </select>

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

@ -188,7 +188,7 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
List<DistributionStockupSelfVO> stockupOffShelf(@Param("param")StockupDTO stockupDTO); List<DistributionStockupSelfVO> stockupOffShelf(@Param("param")StockupDTO stockupDTO);
/** /**
* * 自提
* @param stockupDTO * @param stockupDTO
* @return * @return
*/ */

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

@ -778,7 +778,7 @@
and ldsi.is_deleted = 0 and ldsi.is_deleted = 0
</select> </select>
<select id="getInventoryCheSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO"> <select id="getInventoryCheSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO">
select lddd.quantity reservationStockListNum,ldsi.reservation_id,lds.type_service select lddd.quantity reservationStockListNum,ldsi.reservation_id reservationId,lds.type_service typeService
from logpm_distribution_stockup lds from logpm_distribution_stockup lds
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_distribution_delivery_details lddd on ldsi.reservation_id = lddd.bill_lading_id LEFT JOIN logpm_distribution_delivery_details lddd on ldsi.reservation_id = lddd.bill_lading_id
@ -801,7 +801,7 @@
( (
SELECT COUNT(*) SELECT COUNT(*)
FROM logpm_distribution_parcel_list dpl FROM logpm_distribution_parcel_list dpl
WHERE dpl.stock_article_id = ldbs.stock_article_id WHERE dpl.stock_article_id = ldbs.stock_article_id and dpl.conditions = '1'
) AS reservationNum ) AS reservationNum
from logpm_distribution_stockup_info ldsi from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id

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

@ -100,7 +100,7 @@
LEFT JOIN logpm_distribution_stock_article ldsa on ldsa.id = ldbs.stock_article_id and ldsa.is_zero = '0' LEFT JOIN logpm_distribution_stock_article ldsa on ldsa.id = ldbs.stock_article_id and ldsa.is_zero = '0'
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldsa.id LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldsa.id
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id
where ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId} and ldsa.is_zero = '0' where ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId} and ldsa.is_zero = '0' and ldpl.conditions = '1'
</select> </select>
<select id="exportDistrilbutionBillStock" resultType="com.logpm.distribution.excel.DistrilbutionBillStockExcel"> <select id="exportDistrilbutionBillStock" resultType="com.logpm.distribution.excel.DistrilbutionBillStockExcel">

20
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -79,6 +79,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private final IDistributionStockListInfoService distributionStockListInfoService; private final IDistributionStockListInfoService distributionStockListInfoService;
private final IDistributionStockListService distributionStockListService; private final IDistributionStockListService distributionStockListService;
private final IDistributionReservationZeroPackageService reservationZeroPackageService;
@Override @Override
public IPage<DistributionParcelListEntity> selectDistributionParcelListPage(IPage<DistributionParcelListEntity> page, DistributionParcelListVO distributionParcelList) { public IPage<DistributionParcelListEntity> selectDistributionParcelListPage(IPage<DistributionParcelListEntity> page, DistributionParcelListVO distributionParcelList) {
@ -288,6 +289,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Override @Override
public List<DistributionParcelListZeroVO> getZeroMaterial(Map<String, Object> distributionParcelList) { public List<DistributionParcelListZeroVO> getZeroMaterial(Map<String, Object> distributionParcelList) {
Object o = distributionParcelList.get("stockArticleId"); Object o = distributionParcelList.get("stockArticleId");
Object reservationId = distributionParcelList.get("reservationId");
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
if(ObjectUtils.isNotNull(o)){ if(ObjectUtils.isNotNull(o)){
String a= (String) o; String a= (String) o;
@ -306,14 +308,22 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
List<DistributionParcelListZeroVO> list = new ArrayList<>(); List<DistributionParcelListZeroVO> list = new ArrayList<>();
distributionParcelListEntities.forEach( i ->{ distributionParcelListEntities.forEach( i ->{
//查询在库数量 //查询在库数量
DistributionParcelNumberEntity one = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda() DistributionParcelNumberEntity parcelNumber = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, i.getId()) .eq(DistributionParcelNumberEntity::getParcelListId, i.getId())
.eq(DistributionParcelNumberEntity::getStockArticleId, i.getStockArticleId()) .eq(DistributionParcelNumberEntity::getStockArticleId, i.getStockArticleId()));
DistributionReservationZeroPackageEntity one = reservationZeroPackageService.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getParcelListId, i.getId())
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, i.getStockArticleId())
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
); );
DistributionParcelListZeroVO parcelListVO = new DistributionParcelListZeroVO(); DistributionParcelListZeroVO parcelListVO = new DistributionParcelListZeroVO();
BeanUtils.copyProperties(i,parcelListVO); BeanUtils.copyProperties(i,parcelListVO);
parcelListVO.setLibraryQuantity(one.getHandQuantity()); parcelListVO.setLibraryQuantity(parcelNumber.getHandQuantity());
parcelListVO.setDeliveryQuantity(one.getDeliveryQuantity()); if(ObjectUtils.isNotNull(one)){
parcelListVO.setDeliveryQuantity(one.getQuantity());
}else{
parcelListVO.setDeliveryQuantity(0);
}
list.add(parcelListVO); list.add(parcelListVO);
}); });
return list; return list;

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java

@ -90,13 +90,13 @@ public class DistributionParcelNumberServiceImpl extends BaseServiceImpl<Distrib
DistributionParcelNumberEntity parcelEntity = new DistributionParcelNumberEntity(); DistributionParcelNumberEntity parcelEntity = new DistributionParcelNumberEntity();
switch (i){ switch (i){
case 1: case 1:
//减
parcelEntity.setId(parcelNumberEntity.getId());
parcelEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - i1);
case 2:
//加 //加
parcelEntity.setId(parcelNumberEntity.getId()); parcelEntity.setId(parcelNumberEntity.getId());
parcelEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() + i1); parcelEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() + i1);
case 2:
//减
parcelEntity.setId(parcelNumberEntity.getId());
parcelEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - i1);
} }
baseMapper.updateById(parcelEntity); baseMapper.updateById(parcelEntity);
} }

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -371,8 +371,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
packageEntityList.add(billPackageEntity); packageEntityList.add(billPackageEntity);
}); });
distributionStockArticle.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); distributionStockArticle.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
} }
}else{ }else{
//没有包件 查询包件信息 //没有包件 查询包件信息
@ -404,7 +402,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
distrilbutionBillPackageService.saveBatch(packageEntityList); distrilbutionBillPackageService.saveBatch(packageEntityList);
distributionStockArticle.setId(Long.parseLong(s)); distributionStockArticle.setId(Long.parseLong(s));
distributionStockArticle.setStockupStatus(StockupStatusConstant.daibeihuo.getValue());
distributionStockArticleService.updateById(distributionStockArticle); distributionStockArticleService.updateById(distributionStockArticle);
} }
} }
@ -1464,7 +1461,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//查询 //查询
DistributionStockArticleEntity byId = distributionStockArticleService.getById(i.getStockArticleId()); DistributionStockArticleEntity byId = distributionStockArticleService.getById(i.getStockArticleId());
DistributionParcelNumberEntity one = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getParcelListId, i.getId())); DistributionParcelNumberEntity one = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getParcelListId, i.getId()));
if(ObjectUtils.isNotNull(one)) { if(ObjectUtils.isNotNull(one) && i.getQuantity() <= one.getHandQuantity()) {
nu.addAndGet(i.getQuantity()); nu.addAndGet(i.getQuantity());
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
parcelNumberEntity.setId(one.getId()); parcelNumberEntity.setId(one.getId());
@ -1472,8 +1469,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
parcelNumberEntity.setHandQuantity(byId.getHandQuantity()); parcelNumberEntity.setHandQuantity(byId.getHandQuantity());
parcelNumberEntityList.add(parcelNumberEntity); parcelNumberEntityList.add(parcelNumberEntity);
zeroPackageEntity.setParcelListId(one.getParcelListId()); zeroPackageEntity.setParcelListId(one.getParcelListId());
zeroPackageEntityList.add(zeroPackageEntity);
}else{
throw new ServiceException("配送数量大于在库数量!!");
} }
zeroPackageEntityList.add(zeroPackageEntity);
} }
}); });
if(!parcelNumberEntityList.isEmpty()){ if(!parcelNumberEntityList.isEmpty()){

Loading…
Cancel
Save