Browse Source

合同号盘点调整

training
kilo 1 year ago
parent
commit
98c312a8d7
  1. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskContractVO.java
  2. 17
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskPackagelistVO.java
  3. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java
  4. 381
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  5. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java
  6. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskContractVO.java

@ -51,6 +51,7 @@ public class TaskContractVO {
@ApiModelProperty(value = "是否是库存品 0- 否 1-是") @ApiModelProperty(value = "是否是库存品 0- 否 1-是")
private Integer isInventory; private Integer isInventory;
/** /**
* 包件列表 * 包件列表
*/ */

17
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskPackagelistVO.java

@ -42,12 +42,29 @@ public class TaskPackagelistVO {
@ApiModelProperty(value = "订单号") @ApiModelProperty(value = "订单号")
private Long orderId; private Long orderId;
@ApiModelProperty(value = "盘点详情ID")
private Long questDetailId;
/** /**
* 数量 * 数量
*/ */
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "数量")
private Integer quantity; private Integer quantity;
/**
* 盘点方式
*/
@ApiModelProperty(value = "数量")
private Integer questTarget;
/**
* 盘点任务状态
*/
@ApiModelProperty(value = "数量")
private Integer questStatus;
/** /**
* 数量 * 数量
*/ */

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java

@ -175,7 +175,8 @@ public class DistributionStockupController extends BladeController {
public R<List<User>> listUser() { public R<List<User>> listUser() {
//获取当前登录用户 //获取当前登录用户
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
List<User> cc = distributionStockupService.getRoleList(user.getDeptId(), user.getTenantId(), "拣货员"); // List<User> cc = distributionStockupService.getRoleList(user.getDeptId(), user.getTenantId(), "拣货员");
List<User> cc = distributionStockupService.getRoleList(user.getDeptId(), user.getTenantId(), "叉车");
return R.data(cc); return R.data(cc);
} }

381
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -191,10 +191,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private DistributionReservationZeroPackageMapper distributionReservationZeroPackageMapper; private DistributionReservationZeroPackageMapper distributionReservationZeroPackageMapper;
@Override @Override
public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) { public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) {
return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation)); return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation));
@ -263,8 +259,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelListVOS.add(parcelListVOS); distributionParcelListVOS.add(parcelListVOS);
}); });
distributionStockArticleVO.setPackageList(distributionParcelListVOS); distributionStockArticleVO.setPackageList(distributionParcelListVOS);
}else { } else {
log.error("预约下订单包件信息缺失,订单ID为:{}",rs.getStockArticleId()); log.error("预约下订单包件信息缺失,订单ID为:{}", rs.getStockArticleId());
} }
} else if (rs.getIsZero().equals(IsOrNoConstant.yes.getValue())) { } else if (rs.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
@ -281,16 +277,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}); });
distributionStockArticleVO.setPackageList(distributionParcelListVOS); distributionStockArticleVO.setPackageList(distributionParcelListVOS);
} else { } else {
log.error("#######################预约下订单包件信息缺失,订单ID为:{}",rs.getStockArticleId()); log.error("#######################预约下订单包件信息缺失,订单ID为:{}", rs.getStockArticleId());
} }
}else { } else {
log.error("####################预约订单中间表isZero字段缺失,reservation_stockArticle的ID为:{}",rs.getId()); log.error("####################预约订单中间表isZero字段缺失,reservation_stockArticle的ID为:{}", rs.getId());
} }
distributionStockArticleVOS.add(distributionStockArticleVO); distributionStockArticleVOS.add(distributionStockArticleVO);
}); });
}else { } else {
log.error("######################预约订单信息缺失,reservationID为:{}",reservationEntity.getId()); log.error("######################预约订单信息缺失,reservationID为:{}", reservationEntity.getId());
} }
reservationVO.setStockArticleList(distributionStockArticleVOS); reservationVO.setStockArticleList(distributionStockArticleVOS);
return R.data(reservationVO); return R.data(reservationVO);
@ -319,8 +315,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.status(false); return R.status(false);
} }
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){ if (Func.isEmpty(myCurrentWarehouse)) {
log.error("myCurrentWarehouse参数异常:+{"+myCurrentWarehouse+"}"); log.error("myCurrentWarehouse参数异常:+{" + myCurrentWarehouse + "}");
return R.fail("请先选择作业仓库!!!"); return R.fail("请先选择作业仓库!!!");
} }
//构建预约单 //构建预约单
@ -357,7 +353,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//存在订单构建预约订单关联信息 //存在订单构建预约订单关联信息
if (!Func.isEmpty(stockArticleList)) { if (!Func.isEmpty(stockArticleList)) {
boolean flag = stockArticleList.stream().anyMatch(s -> s.getReservationStatus().equals(OrderReservationStatusConstant.yiyueyue.getValue())); boolean flag = stockArticleList.stream().anyMatch(s -> s.getReservationStatus().equals(OrderReservationStatusConstant.yiyueyue.getValue()));
if (flag){ if (flag) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error("预约选择订单被多次预约"); log.error("预约选择订单被多次预约");
return R.fail("订单已预约!!!"); return R.fail("订单已预约!!!");
@ -367,14 +363,14 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
stockArticleList.forEach(s -> { stockArticleList.forEach(s -> {
// WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(s.getWaybillNumber()); // WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(s.getWaybillNumber());
WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(s.getWaybillNumber()); WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(s.getWaybillNumber());
if (Func.isNotEmpty(wayBillEntity)){ if (Func.isNotEmpty(wayBillEntity)) {
waybillId.add(wayBillEntity.getId().toString()); waybillId.add(wayBillEntity.getId().toString());
if (Func.isNotEmpty(wayBillEntity.getTakePhone())){ if (Func.isNotEmpty(wayBillEntity.getTakePhone())) {
marketPhone.add(wayBillEntity.getTakePhone()); marketPhone.add(wayBillEntity.getTakePhone());
} }
} }
if (Func.isNotEmpty(s.getWaybillNumber())){ if (Func.isNotEmpty(s.getWaybillNumber())) {
waybillNo.add(s.getWaybillNumber()); waybillNo.add(s.getWaybillNumber());
} }
if (Func.isNotBlank(s.getServiceNumber())) { if (Func.isNotBlank(s.getServiceNumber())) {
@ -546,7 +542,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setWaybillNo(String.join(",", waybillNo)); reservationEntity.setWaybillNo(String.join(",", waybillNo));
reservationEntity.setWaybillId(String.join(",", waybillId)); reservationEntity.setWaybillId(String.join(",", waybillId));
reservationEntity.setMailPhone(String.join(",", marketPhone)); reservationEntity.setMailPhone(String.join(",", marketPhone));
reservationEntity.setReceivingUnit(String.join(",",receivingUnit)); reservationEntity.setReceivingUnit(String.join(",", receivingUnit));
//统计数量 //统计数量
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee()); BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee); reservationEntity.setFee(fee);
@ -561,7 +557,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
String s = String.join(",", serviceNumber); String s = String.join(",", serviceNumber);
reservationEntity.setServiceNumber(s); reservationEntity.setServiceNumber(s);
reservationEntity.setReservationStatus(ReservationStatusConstant.daiqueren.getValue()); reservationEntity.setReservationStatus(ReservationStatusConstant.daiqueren.getValue());
if (Func.isNotEmpty(distributionReservationDTO.getServeType())){ if (Func.isNotEmpty(distributionReservationDTO.getServeType())) {
reservationEntity.setServeType(distributionReservationDTO.getServeType()); reservationEntity.setServeType(distributionReservationDTO.getServeType());
} }
// reservationEntity.setReservationNum(stockArticleCount.get()); // reservationEntity.setReservationNum(stockArticleCount.get());
@ -722,8 +718,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.fail("服务器正忙!!!"); return R.fail("服务器正忙!!!");
} }
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){ if (Func.isEmpty(myCurrentWarehouse)) {
log.error("myCurrentWarehouse参数异常:+{"+myCurrentWarehouse+"}"); log.error("myCurrentWarehouse参数异常:+{" + myCurrentWarehouse + "}");
return R.fail("请先选择作业仓库!!!"); return R.fail("请先选择作业仓库!!!");
} }
boolean result = false; boolean result = false;
@ -739,7 +735,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionStockupEntity stockupEntity = new DistributionStockupEntity(); DistributionStockupEntity stockupEntity = new DistributionStockupEntity();
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
stockupEntity.setStockupUser(user.getUserName()); stockupEntity.setStockupUser(user.getUserName());
if (Func.isNotEmpty(goddsAreaId)){ if (Func.isNotEmpty(goddsAreaId)) {
stockupEntity.setStockupArea(stockupAreaName); stockupEntity.setStockupArea(stockupAreaName);
stockupEntity.setGoodsAreaId(Long.parseLong(goddsAreaId)); stockupEntity.setGoodsAreaId(Long.parseLong(goddsAreaId));
} }
@ -760,8 +756,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Long id = stockupEntity.getId(); Long id = stockupEntity.getId();
List<Long> reservationIds = Func.toLongList(ids); List<Long> reservationIds = Func.toLongList(ids);
List<DistributionReservationEntity> reservationEntityList = distributionReservationMapper.selectList(Wrappers.<DistributionReservationEntity>query().lambda().in(DistributionReservationEntity::getId, reservationIds)); List<DistributionReservationEntity> reservationEntityList = distributionReservationMapper.selectList(Wrappers.<DistributionReservationEntity>query().lambda().in(DistributionReservationEntity::getId, reservationIds));
if (Func.isNotEmpty(reservationEntityList)){ if (Func.isNotEmpty(reservationEntityList)) {
reservationEntityList.forEach(r->{ reservationEntityList.forEach(r -> {
r.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); r.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
distributionReservationMapper.updateById(r); distributionReservationMapper.updateById(r);
DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity(); DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity();
@ -808,13 +804,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<DistributionReservationVO> reservationVOList = null; List<DistributionReservationVO> reservationVOList = null;
if (Func.isNotEmpty(myCurrentWarehouse)){ if (Func.isNotEmpty(myCurrentWarehouse)) {
List<Long> longs = Func.toLongList(ids); List<Long> longs = Func.toLongList(ids);
List<DistributionReservationEntity> reservationEntityList = this.listByIds(longs); List<DistributionReservationEntity> reservationEntityList = this.listByIds(longs);
reservationVOList = DistributionReservationWrapper.build().listVO(reservationEntityList); reservationVOList = DistributionReservationWrapper.build().listVO(reservationEntityList);
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(reservationVOList.get(0).getWarehouseId()); BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(reservationVOList.get(0).getWarehouseId());
if (Func.isNotEmpty(entityWarehouseId)){ if (Func.isNotEmpty(entityWarehouseId)) {
reservationVOList.stream().forEach(r->{r.setJingdu(entityWarehouseId.getLongitude());r.setWeidu(entityWarehouseId.getLatitude());}); reservationVOList.stream().forEach(r -> {
r.setJingdu(entityWarehouseId.getLongitude());
r.setWeidu(entityWarehouseId.getLatitude());
});
} }
} }
@ -846,7 +845,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.fail("服务器正忙!!!"); return R.fail("服务器正忙!!!");
} }
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){ if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail("无仓库信息!!!"); return R.fail("无仓库信息!!!");
} }
String reservationIds = allocationDTO.getReservationIds(); String reservationIds = allocationDTO.getReservationIds();
@ -1086,7 +1085,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId()); distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId());
distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName()); distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName());
} }
if (Func.isNotEmpty(stockup.getUnloaderId()) && Func.isNotEmpty(stockup.getUnloaderName()) ) { if (Func.isNotEmpty(stockup.getUnloaderId()) && Func.isNotEmpty(stockup.getUnloaderName())) {
distributionDeliveryListEntity.setUnloadingTeamId(stockup.getUnloaderId()); distributionDeliveryListEntity.setUnloadingTeamId(stockup.getUnloaderId());
distributionDeliveryListEntity.setUnloadingTeamName(stockup.getUnloaderName()); distributionDeliveryListEntity.setUnloadingTeamName(stockup.getUnloaderName());
} }
@ -1108,7 +1107,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// } catch (ParseException e) { // } catch (ParseException e) {
// e.printStackTrace(); // e.printStackTrace();
// } // }
if (Func.isNotEmpty(allocationDTO.getRemarks())){ if (Func.isNotEmpty(allocationDTO.getRemarks())) {
distributionDeliveryListEntity.setRemarks(allocationDTO.getRemarks()); distributionDeliveryListEntity.setRemarks(allocationDTO.getRemarks());
} }
distributionDeliveryListEntity.setTaskTime(taskTime); distributionDeliveryListEntity.setTaskTime(taskTime);
@ -1142,14 +1141,14 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleWrapper.build().listVO(distrinbutionStockArticleVOS); List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleWrapper.build().listVO(distrinbutionStockArticleVOS);
stockArticleVOS.forEach(s -> { stockArticleVOS.forEach(s -> {
//区分正常订单和零担订单 //区分正常订单和零担订单
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//这里查询两个东西,一个是该订单在预约中所被选取的包件信息,以及该订单下所有的包件列表 //这里查询两个东西,一个是该订单在预约中所被选取的包件信息,以及该订单下所有的包件列表
List<DistributionParcelListEntity> pageVOList = distributionParcelListMapper.getPageVOList(s.getId()); List<DistributionParcelListEntity> pageVOList = distributionParcelListMapper.getPageVOList(s.getId());
s.setParcelListVOS(DistributionParcelListWrapper.build().listVO(pageVOList)); s.setParcelListVOS(DistributionParcelListWrapper.build().listVO(pageVOList));
//这里查询出该订单下已经被选取的包件信息 //这里查询出该订单下已经被选取的包件信息
List<DistributionParcelListEntity> packageVOList = distributionReservationPackageMapper.selectPackageVOList(reservationEntity.getId(), s.getId()); List<DistributionParcelListEntity> packageVOList = distributionReservationPackageMapper.selectPackageVOList(reservationEntity.getId(), s.getId());
s.setPackageList(DistributionParcelListWrapper.build().listVO(packageVOList)); s.setPackageList(DistributionParcelListWrapper.build().listVO(packageVOList));
}else { } else {
List<DistributionParcelNumberVO> parcelNumberVOS = baseMapper.selectReservationZeroOrderDetail(s.getId(), Long.parseLong(reservationId)); List<DistributionParcelNumberVO> parcelNumberVOS = baseMapper.selectReservationZeroOrderDetail(s.getId(), Long.parseLong(reservationId));
s.setParcelNumberVOS(parcelNumberVOS); s.setParcelNumberVOS(parcelNumberVOS);
} }
@ -1170,8 +1169,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.status(false); return R.status(false);
} }
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){ if (Func.isEmpty(myCurrentWarehouse)) {
log.error("myCurrentWarehouse参数异常:+{"+myCurrentWarehouse+"}"); log.error("myCurrentWarehouse参数异常:+{" + myCurrentWarehouse + "}");
return R.fail("请先选择作业仓库!!!"); return R.fail("请先选择作业仓库!!!");
} }
//推翻原有的 //推翻原有的
@ -1192,7 +1191,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//这里发生了新增订单的操作 //这里发生了新增订单的操作
AtomicInteger packageNum = new AtomicInteger(); AtomicInteger packageNum = new AtomicInteger();
DistributionStockArticleDTO distributionStockArticleDTO = v.get(0); DistributionStockArticleDTO distributionStockArticleDTO = v.get(0);
if (distributionStockArticleDTO.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (distributionStockArticleDTO.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionParcelListDTO> packageListInfo = distributionStockArticleDTO.getPackageListInfo(); List<DistributionParcelListDTO> packageListInfo = distributionStockArticleDTO.getPackageListInfo();
packageListInfo.forEach(p -> { packageListInfo.forEach(p -> {
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
@ -1208,14 +1207,14 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelListService.updateById(parcelListEntity); distributionParcelListService.updateById(parcelListEntity);
}); });
}else { } else {
//新增了零担订单 //新增了零担订单
List<DistributionParcelNumberVO> parcelNumberVOS = distributionStockArticleDTO.getParcelNumberVOS(); List<DistributionParcelNumberVO> parcelNumberVOS = distributionStockArticleDTO.getParcelNumberVOS();
AtomicInteger zeroPackageNum = new AtomicInteger(); AtomicInteger zeroPackageNum = new AtomicInteger();
if (Func.isNotEmpty(parcelNumberVOS)){ if (Func.isNotEmpty(parcelNumberVOS)) {
//进行录入数量的操作 //进行录入数量的操作
parcelNumberVOS.forEach(p->{ parcelNumberVOS.forEach(p -> {
if (p.getReservationNum() >0){ if (p.getReservationNum() > 0) {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setQuantity(p.getReservationNum()); distributionReservationZeroPackageEntity.setQuantity(p.getReservationNum());
distributionReservationZeroPackageEntity.setReservationId(id); distributionReservationZeroPackageEntity.setReservationId(id);
@ -1233,10 +1232,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelNumberService.updateById(parcelNumberEntity); distributionParcelNumberService.updateById(parcelNumberEntity);
} }
}); });
}else { } else {
//没有进行录入数量的操作,查询可进行添加的品类数量进行全部添加 //没有进行录入数量的操作,查询可进行添加的品类数量进行全部添加
List<DistributionParcelNumberVO> list = distributionStockArticleService.getZeroOrderDetail(distributionStockArticleDTO.getId()); List<DistributionParcelNumberVO> list = distributionStockArticleService.getZeroOrderDetail(distributionStockArticleDTO.getId());
list.forEach(l->{ list.forEach(l -> {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setQuantity(l.getQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity()); distributionReservationZeroPackageEntity.setQuantity(l.getQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity());
distributionReservationZeroPackageEntity.setReservationId(id); distributionReservationZeroPackageEntity.setReservationId(id);
@ -1286,7 +1285,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} else { } else {
//查询出这个订单原来在这个预约中的勾选情况 //查询出这个订单原来在这个预约中的勾选情况
DistributionStockArticleDTO distributionStockArticleDTO = v.get(0); DistributionStockArticleDTO distributionStockArticleDTO = v.get(0);
if (distributionStockArticleDTO.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (distributionStockArticleDTO.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageMapper.selectPackageByReservationAndStockArticleId(id, k); List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageMapper.selectPackageByReservationAndStockArticleId(id, k);
Map<Long, List<DistributionReservationPackageEntity>> oldPackage = packageEntityList.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getParceListId)); Map<Long, List<DistributionReservationPackageEntity>> oldPackage = packageEntityList.stream().collect(Collectors.groupingBy(DistributionReservationPackageEntity::getParceListId));
Map<Long, List<DistributionParcelListEntity>> newPackage = distributionStockArticleDTO.getPackageListInfo().stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getId)); Map<Long, List<DistributionParcelListEntity>> newPackage = distributionStockArticleDTO.getPackageListInfo().stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getId));
@ -1332,24 +1331,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// oldStockArticle.remove(k); // oldStockArticle.remove(k);
distributionAsyncService.changeOrderReservationStatus(distributionStockArticleDTO); distributionAsyncService.changeOrderReservationStatus(distributionStockArticleDTO);
oldStockArticle.remove(k); oldStockArticle.remove(k);
}else { } else {
//零担订单出现编辑操作,这里对于零担订单发生编辑操作一定会存在有录入数量的操作 //零担订单出现编辑操作,这里对于零担订单发生编辑操作一定会存在有录入数量的操作
List<DistributionParcelNumberVO> parcelNumberVOS = distributionStockArticleDTO.getParcelNumberVOS(); List<DistributionParcelNumberVO> parcelNumberVOS = distributionStockArticleDTO.getParcelNumberVOS();
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, id) .eq(DistributionReservationZeroPackageEntity::getReservationId, id)
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionStockArticleDTO.getId()) .eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionStockArticleDTO.getId())
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus,"2")); .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "2"));
Map<Long, List<DistributionReservationZeroPackageEntity>> oldZeroPackage = reservationZeroPackageEntityList.stream().collect(Collectors.groupingBy(DistributionReservationZeroPackageEntity::getParcelListId)); Map<Long, List<DistributionReservationZeroPackageEntity>> oldZeroPackage = reservationZeroPackageEntityList.stream().collect(Collectors.groupingBy(DistributionReservationZeroPackageEntity::getParcelListId));
if (Func.isEmpty(reservationZeroPackageEntityList)){ if (Func.isEmpty(reservationZeroPackageEntityList)) {
log.error("#############零担订单预约信息数据错误:{}",distributionStockArticleDTO); log.error("#############零担订单预约信息数据错误:{}", distributionStockArticleDTO);
} }
AtomicInteger zeroPrderNum = new AtomicInteger(); AtomicInteger zeroPrderNum = new AtomicInteger();
parcelNumberVOS.forEach(p->{ parcelNumberVOS.forEach(p -> {
List<DistributionReservationZeroPackageEntity> distributionReservationZeroPackageEntities = oldZeroPackage.get(p.getParcelListId()); List<DistributionReservationZeroPackageEntity> distributionReservationZeroPackageEntities = oldZeroPackage.get(p.getParcelListId());
if (Func.isNotEmpty(distributionReservationZeroPackageEntities)){ if (Func.isNotEmpty(distributionReservationZeroPackageEntities)) {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = distributionReservationZeroPackageEntities.get(0); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = distributionReservationZeroPackageEntities.get(0);
Integer quantity = distributionReservationZeroPackageEntity.getQuantity(); Integer quantity = distributionReservationZeroPackageEntity.getQuantity();
if (p.getReservationNum() == 0){ if (p.getReservationNum() == 0) {
distributionReservationZeroPackageEntity.setQuantity(0); distributionReservationZeroPackageEntity.setQuantity(0);
distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.quxiao.getValue()); distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.quxiao.getValue());
distributionReservationZeroPackageService.updateById(distributionReservationZeroPackageEntity); distributionReservationZeroPackageService.updateById(distributionReservationZeroPackageEntity);
@ -1357,7 +1356,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.eq(DistributionParcelNumberEntity::getParcelListId, distributionReservationZeroPackageEntity.getParcelListId())); .eq(DistributionParcelNumberEntity::getParcelListId, distributionReservationZeroPackageEntity.getParcelListId()));
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - quantity); parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - quantity);
distributionParcelNumberService.updateById(parcelNumberEntity); distributionParcelNumberService.updateById(parcelNumberEntity);
}else if (p.getReservationNum() != quantity){ } else if (p.getReservationNum() != quantity) {
distributionReservationZeroPackageEntity.setQuantity(p.getReservationNum()); distributionReservationZeroPackageEntity.setQuantity(p.getReservationNum());
distributionReservationZeroPackageService.updateById(distributionReservationZeroPackageEntity); distributionReservationZeroPackageService.updateById(distributionReservationZeroPackageEntity);
//进行修改操作 //进行修改操作
@ -1367,7 +1366,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelNumberService.updateById(parcelNumberEntity); distributionParcelNumberService.updateById(parcelNumberEntity);
} }
zeroPrderNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity()); zeroPrderNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity());
}else { } else {
//这里就是新增 //这里就是新增
DistributionReservationZeroPackageEntity zeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity zeroPackageEntity = new DistributionReservationZeroPackageEntity();
zeroPackageEntity.setParcelListId(p.getParcelListId()); zeroPackageEntity.setParcelListId(p.getParcelListId());
@ -1417,7 +1416,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
oldStockArticle.forEach((i, j) -> { oldStockArticle.forEach((i, j) -> {
//这里就是需要进行取消的订单信息 //这里就是需要进行取消的订单信息
DistributionReservationStockarticleEntity reservationStockarticleEntity = j.get(0); DistributionReservationStockarticleEntity reservationStockarticleEntity = j.get(0);
if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageMapper.selectPackageByReservationAndStockArticleId(id, reservationStockarticleEntity.getStockArticleId()); List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageMapper.selectPackageByReservationAndStockArticleId(id, reservationStockarticleEntity.getStockArticleId());
packageEntityList.forEach(p -> { packageEntityList.forEach(p -> {
@ -1429,17 +1428,17 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelListService.updateById(parcelListEntity); distributionParcelListService.updateById(parcelListEntity);
}); });
}else { } else {
//订单零担移除 //订单零担移除
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationStockarticleEntity.getReservationId()) .eq(DistributionReservationZeroPackageEntity::getReservationId, reservationStockarticleEntity.getReservationId())
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId()) .eq(DistributionReservationZeroPackageEntity::getStockArticleId, reservationStockarticleEntity.getStockArticleId())
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationOrderStatusConstant.quxiao.getValue())); .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationOrderStatusConstant.quxiao.getValue()));
reservationZeroPackageEntities.forEach(zp->{ reservationZeroPackageEntities.forEach(zp -> {
List<DistributionParcelNumberEntity> parcelNumberEntityList = distributionParcelNumberService.list(Wrappers.<DistributionParcelNumberEntity>query().lambda() List<DistributionParcelNumberEntity> parcelNumberEntityList = distributionParcelNumberService.list(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, zp.getParcelListId())); .eq(DistributionParcelNumberEntity::getParcelListId, zp.getParcelListId()));
if (parcelNumberEntityList.size()>1){ if (parcelNumberEntityList.size() > 1) {
log.error("#############零担订单品类信息错误:{}",parcelNumberEntityList); log.error("#############零担订单品类信息错误:{}", parcelNumberEntityList);
} }
DistributionParcelNumberEntity parcelNumberEntity = parcelNumberEntityList.get(0); DistributionParcelNumberEntity parcelNumberEntity = parcelNumberEntityList.get(0);
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - zp.getQuantity()); parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - zp.getQuantity());
@ -1522,21 +1521,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//具体判断是增加还是减少 //具体判断是增加还是减少
Integer oldReservationNum = distributionReservationStocklistEntity.getReservationNum(); Integer oldReservationNum = distributionReservationStocklistEntity.getReservationNum();
Integer newReservationNum = distributionStockListDTO.getReservationNum(); Integer newReservationNum = distributionStockListDTO.getReservationNum();
if (oldReservationNum > newReservationNum){ if (oldReservationNum > newReservationNum) {
//对应库存品减少 //对应库存品减少
//查询出对应的库存品信息,进行取消状态标识 //查询出对应的库存品信息,进行取消状态标识
int count = oldReservationNum - newReservationNum; int count = oldReservationNum - newReservationNum;
List<DisStockListDetailEntity> disStockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() List<DisStockListDetailEntity> disStockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, id) .eq(DisStockListDetailEntity::getReservationId, id)
.eq(DisStockListDetailEntity::getStockListId,distributionReservationStocklistEntity.getStocklistId()) .eq(DisStockListDetailEntity::getStockListId, distributionReservationStocklistEntity.getStocklistId())
.ne(DisStockListDetailEntity::getStockLockingStatus, InventoryPackageStatusConstant.quxiao.getValue())); .ne(DisStockListDetailEntity::getStockLockingStatus, InventoryPackageStatusConstant.quxiao.getValue()));
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
DisStockListDetailEntity disStockListDetailEntity = disStockListDetailEntities.get(i); DisStockListDetailEntity disStockListDetailEntity = disStockListDetailEntities.get(i);
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue()); disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue());
disStockListDetailService.updateById(disStockListDetailEntity); disStockListDetailService.updateById(disStockListDetailEntity);
} }
}else { } else {
int count =newReservationNum - oldReservationNum ; int count = newReservationNum - oldReservationNum;
List<DisStockListDetailEntity> detailEntities = new ArrayList<>(); List<DisStockListDetailEntity> detailEntities = new ArrayList<>();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
//构建库存品 //构建库存品
@ -1587,7 +1586,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
disStockListDetailMapper.deleteInventoryByStockListId(distributionReservationStocklistEntity.getId()); disStockListDetailMapper.deleteInventoryByStockListId(distributionReservationStocklistEntity.getId());
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, distributionReservationStocklistEntity.getReservationId()).eq(DisStockListDetailEntity::getStockListId, distributionReservationStocklistEntity.getStocklistId())); .eq(DisStockListDetailEntity::getReservationId, distributionReservationStocklistEntity.getReservationId()).eq(DisStockListDetailEntity::getStockListId, distributionReservationStocklistEntity.getStocklistId()));
list.forEach(l->l.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue())); list.forEach(l -> l.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue()));
disStockListDetailService.updateBatchById(list); disStockListDetailService.updateBatchById(list);
//TODO 删除库存品包件信息 //TODO 删除库存品包件信息
}); });
@ -1623,7 +1622,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.fail("服务器正忙!!!"); return R.fail("服务器正忙!!!");
} }
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){ if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail("无仓库信息!!!"); return R.fail("无仓库信息!!!");
} }
//1、添加配送任务 //1、添加配送任务
@ -1681,7 +1680,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//查询运单信息 //查询运单信息
//收货单位 //收货单位
Date date = new Date(); Date date = new Date();
mallClient.forEach((k,v)->{ mallClient.forEach((k, v) -> {
clientTotal.getAndIncrement(); clientTotal.getAndIncrement();
// AtomicInteger receivingUnit = new AtomicInteger(); // AtomicInteger receivingUnit = new AtomicInteger();
//这里查询有问题 //这里查询有问题
@ -1723,7 +1722,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
HashSet<String> consigneeAddress = new HashSet<>(); HashSet<String> consigneeAddress = new HashSet<>();
//运单客户收货单位 //运单客户收货单位
HashSet<String> consignee = new HashSet<>(); HashSet<String> consignee = new HashSet<>();
v.forEach(s->{ v.forEach(s -> {
DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class); DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class);
// WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(s.getWaybillNumber()); // WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(s.getWaybillNumber());
// if (Func.isNotEmpty(warehouseWaybillEntity.getConsigneeMobile())){ // if (Func.isNotEmpty(warehouseWaybillEntity.getConsigneeMobile())){
@ -1734,60 +1733,60 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// } // }
WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(s.getWaybillNumber()); WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(s.getWaybillNumber());
if (Func.isNotEmpty(wayBillEntity)){ if (Func.isNotEmpty(wayBillEntity)) {
waybillId.add(wayBillEntity.getId().toString()); waybillId.add(wayBillEntity.getId().toString());
if (Func.isNotEmpty(wayBillEntity.getTakePhone())){ if (Func.isNotEmpty(wayBillEntity.getTakePhone())) {
marketPhone.add(wayBillEntity.getTakePhone()); marketPhone.add(wayBillEntity.getTakePhone());
} }
if (Func.isNotEmpty(wayBillEntity.getTakeAddress())){ if (Func.isNotEmpty(wayBillEntity.getTakeAddress())) {
consigneeAddress.add(wayBillEntity.getTakeAddress()); consigneeAddress.add(wayBillEntity.getTakeAddress());
} }
} }
//预约单数据填充 //预约单数据填充
if (Func.isNotEmpty(s.getMallName())){ if (Func.isNotEmpty(s.getMallName())) {
mallName.add(s.getMallName()); mallName.add(s.getMallName());
} }
if (Func.isNotEmpty(s.getStoreName())){ if (Func.isNotEmpty(s.getStoreName())) {
storeName.add(s.getStoreName()); storeName.add(s.getStoreName());
} }
if (Func.isNotEmpty(s.getOrderCode())){ if (Func.isNotEmpty(s.getOrderCode())) {
orderNumber.add(s.getOrderCode()); orderNumber.add(s.getOrderCode());
} }
// if (Func.isNotEmpty(s.getWaybillNumber())){ // if (Func.isNotEmpty(s.getWaybillNumber())){
// waybillNo.add(s.getWaybillNumber()); // waybillNo.add(s.getWaybillNumber());
// } // }
if (Func.isNotEmpty(s.getWarehouse())){ if (Func.isNotEmpty(s.getWarehouse())) {
warehouseName.add(s.getWarehouse()); warehouseName.add(s.getWarehouse());
} }
// if (Func.isNotEmpty(s.getWaybillId())){ // if (Func.isNotEmpty(s.getWaybillId())){
// waybillId.add(s.getWaybillId().toString()); // waybillId.add(s.getWaybillId().toString());
// } // }
if (Func.isNotEmpty(s.getWaybillNumber())){ if (Func.isNotEmpty(s.getWaybillNumber())) {
waybillNo.add(s.getWaybillNumber()); waybillNo.add(s.getWaybillNumber());
} }
if (Func.isNotEmpty(s.getConsigneeUnit())){ if (Func.isNotEmpty(s.getConsigneeUnit())) {
consignee.add(s.getConsigneeUnit()); consignee.add(s.getConsigneeUnit());
} }
if (Func.isNotEmpty(s.getConsigneePerson())){ if (Func.isNotEmpty(s.getConsigneePerson())) {
consigneeName.add(s.getConsigneePerson()); consigneeName.add(s.getConsigneePerson());
} }
if (Func.isNotEmpty(s.getConsigneeMobile())){ if (Func.isNotEmpty(s.getConsigneeMobile())) {
consigneeMobile.add(s.getConsigneeMobile()); consigneeMobile.add(s.getConsigneeMobile());
} }
// if (Func.isNotEmpty(s.getConsigneeAddress())){ // if (Func.isNotEmpty(s.getConsigneeAddress())){
// consigneeAddress.add(s.getConsigneeAddress()); // consigneeAddress.add(s.getConsigneeAddress());
// } // }
if (Func.isNotEmpty(s.getServiceNumber())){ if (Func.isNotEmpty(s.getServiceNumber())) {
serviceNumber.add(s.getServiceNumber()); serviceNumber.add(s.getServiceNumber());
} }
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity();
AtomicInteger reservationOrderNum = new AtomicInteger(); AtomicInteger reservationOrderNum = new AtomicInteger();
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//现在前端进行订单提交必然会携带包件信息 //现在前端进行订单提交必然会携带包件信息
List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo(); List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo();
if (packageListInfo.size()>0){ if (packageListInfo.size() > 0) {
packageListInfo.forEach(p->{ packageListInfo.forEach(p -> {
reservationOrderNum.getAndAdd(p.getQuantity()); reservationOrderNum.getAndAdd(p.getQuantity());
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.zhengchang.getValue()); reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.zhengchang.getValue());
@ -1801,17 +1800,17 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//这里根据包件进行订单状态的改变 //这里根据包件进行订单状态的改变
distributionAsyncService.checkStockArticleReservationStatus(p); distributionAsyncService.checkStockArticleReservationStatus(p);
}); });
}else { } else {
log.error("订单包件参数有误+{"+packageListInfo+"}"); log.error("订单包件参数有误+{" + packageListInfo + "}");
return; return;
} }
} else { } else {
//-----------------------------------------------------------2023-10-11--- 零担商配处理----------------------------------------------------------------------- //-----------------------------------------------------------2023-10-11--- 零担商配处理-----------------------------------------------------------------------
List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS(); List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS();
if (Func.isNotEmpty(parcelNumberVOS)){ if (Func.isNotEmpty(parcelNumberVOS)) {
//这里需要先进行是否满足 //这里需要先进行是否满足
parcelNumberVOS.forEach(p->{ parcelNumberVOS.forEach(p -> {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.zhengchang.getValue()); distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.zhengchang.getValue());
distributionReservationZeroPackageEntity.setQuantity(p.getHandQuantity() - p.getDeliveryQuantity() - p.getOutboundQuantity()); distributionReservationZeroPackageEntity.setQuantity(p.getHandQuantity() - p.getDeliveryQuantity() - p.getOutboundQuantity());
@ -1826,10 +1825,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelNumberService.updateById(p); distributionParcelNumberService.updateById(p);
reservationOrderNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity()); reservationOrderNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity());
}); });
}else { } else {
List<DistributionParcelNumberVO> list = distributionStockArticleService.getZeroOrderDetail(s.getId()); List<DistributionParcelNumberVO> list = distributionStockArticleService.getZeroOrderDetail(s.getId());
if (Func.isNotEmpty(list)){ if (Func.isNotEmpty(list)) {
list.forEach(l->{ list.forEach(l -> {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.zhengchang.getValue()); distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.zhengchang.getValue());
distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity()); distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity());
@ -1844,8 +1843,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelNumberService.updateById(l); distributionParcelNumberService.updateById(l);
reservationOrderNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity()); reservationOrderNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity());
}); });
}else { } else {
log.error("###########################零担订单查询品类错误,订单ID:{}",s.getId()); log.error("###########################零担订单查询品类错误,订单ID:{}", s.getId());
} }
} }
} }
@ -1962,15 +1961,15 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (!Func.isEmpty(taskTime)) { if (!Func.isEmpty(taskTime)) {
distributionDeliveryListEntity.setTaskTime(taskTime); distributionDeliveryListEntity.setTaskTime(taskTime);
} }
if (Func.isNotEmpty(allocationDTO.getRemarks())){ if (Func.isNotEmpty(allocationDTO.getRemarks())) {
distributionDeliveryListEntity.setRemarks(allocationDTO.getRemarks()); distributionDeliveryListEntity.setRemarks(allocationDTO.getRemarks());
} }
if (Func.isNotEmpty(stockup.getUnloaderId()) &&Func.isNotEmpty(stockup.getUnloaderName()) ){ if (Func.isNotEmpty(stockup.getUnloaderId()) && Func.isNotEmpty(stockup.getUnloaderName())) {
distributionDeliveryListEntity.setUnloadingTeamId(stockup.getUnloaderId()); distributionDeliveryListEntity.setUnloadingTeamId(stockup.getUnloaderId());
distributionDeliveryListEntity.setUnloadingTeamName(stockup.getUnloaderName()); distributionDeliveryListEntity.setUnloadingTeamName(stockup.getUnloaderName());
} }
if (Func.isNotEmpty(stockup.getLoaderId()) &&Func.isNotEmpty(stockup.getLoaderName()) ){ if (Func.isNotEmpty(stockup.getLoaderId()) && Func.isNotEmpty(stockup.getLoaderName())) {
distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId()); distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId());
distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName()); distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName());
} }
@ -2139,7 +2138,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
DistributionReservationEntity reservationEntity = this.getById(reservationDTO.getId()); DistributionReservationEntity reservationEntity = this.getById(reservationDTO.getId());
if (Func.isEmpty(reservationEntity)) { if (Func.isEmpty(reservationEntity)) {
log.error("参数异常reservationEntity:{}" , reservationEntity ); log.error("参数异常reservationEntity:{}", reservationEntity);
return false; return false;
} }
// ------------------------取消预约需要重新调整———————————————————————————————————————————————————— // ------------------------取消预约需要重新调整————————————————————————————————————————————————————
@ -2152,44 +2151,44 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda() List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()) .eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId())
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationStockarticleEntityList) && reservationStockarticleEntityList.size()>0){ if (Func.isNotEmpty(reservationStockarticleEntityList) && reservationStockarticleEntityList.size() > 0) {
reservationStockarticleEntityList.forEach(rs->{ reservationStockarticleEntityList.forEach(rs -> {
rs.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); rs.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
distributionReservationStockarticleService.updateById(rs); distributionReservationStockarticleService.updateById(rs);
if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//订制品 //订制品
//需要进行包件的预约状态维护 //需要进行包件的预约状态维护
List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda() List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, rs.getReservationId()) .eq(DistributionReservationPackageEntity::getReservationId, rs.getReservationId())
.eq(DistributionReservationPackageEntity::getStockArticleId, rs.getStockArticleId()) .eq(DistributionReservationPackageEntity::getStockArticleId, rs.getStockArticleId())
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())); .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationPackageEntityList) && reservationPackageEntityList.size()>0){ if (Func.isNotEmpty(reservationPackageEntityList) && reservationPackageEntityList.size() > 0) {
reservationPackageEntityList.forEach(rp->{ reservationPackageEntityList.forEach(rp -> {
rp.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue()); rp.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(rp); distributionReservationPackageService.updateById(rp);
//维护包件状态 //维护包件状态
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId()); DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId());
if (Func.isNotEmpty(parcelListEntity)){ if (Func.isNotEmpty(parcelListEntity)) {
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue()); parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity); distributionParcelListService.updateById(parcelListEntity);
distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity); distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
}else { } else {
log.error("#################错误包件ID:{}",rp.getParceListId()); log.error("#################错误包件ID:{}", rp.getParceListId());
} }
}); });
} }
}else if (rs.getIsZero().equals(IsOrNoConstant.yes.getValue())){ } else if (rs.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
//零担 //零担
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationEntity.getId()) .eq(DistributionReservationZeroPackageEntity::getReservationId, reservationEntity.getId())
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, rs.getStockArticleId()) .eq(DistributionReservationZeroPackageEntity::getStockArticleId, rs.getStockArticleId())
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
reservationZeroPackageEntityList.forEach(rzp->{ reservationZeroPackageEntityList.forEach(rzp -> {
rzp.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); rzp.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationZeroPackageService.updateById(rzp); distributionReservationZeroPackageService.updateById(rzp);
DistributionParcelNumberEntity parcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda() DistributionParcelNumberEntity parcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, rzp.getParcelListId())); .eq(DistributionParcelNumberEntity::getParcelListId, rzp.getParcelListId()));
if (Func.isNotEmpty(parcelNumberEntity)){ if (Func.isNotEmpty(parcelNumberEntity)) {
// parcelNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity() + rzp.getQuantity()); // parcelNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity() + rzp.getQuantity());
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - rzp.getQuantity()); parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - rzp.getQuantity());
distributionParcelNumberService.updateById(parcelNumberEntity); distributionParcelNumberService.updateById(parcelNumberEntity);
@ -2197,16 +2196,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
}); });
}else { } else {
log.error("######################预约订单isZero字段维护错误,reservation_stockarticle的ID为:{}",rs.getId()); log.error("######################预约订单isZero字段维护错误,reservation_stockarticle的ID为:{}", rs.getId());
} }
}); });
} }
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationEntity.getId()); List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationEntity.getId());
if (Func.isNotEmpty(distributionReservationStocklistEntities) && distributionReservationStocklistEntities.size() > 0){ if (Func.isNotEmpty(distributionReservationStocklistEntities) && distributionReservationStocklistEntities.size() > 0) {
//进行库存品库存数量的维护 //进行库存品库存数量的维护
distributionReservationStocklistEntities.forEach(i->{ distributionReservationStocklistEntities.forEach(i -> {
DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getStocklistId()); DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getStocklistId());
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - i.getReservationNum()); stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - i.getReservationNum());
distributionStockListService.updateById(stockListEntity); distributionStockListService.updateById(stockListEntity);
@ -2216,7 +2215,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//执行物理删除 //执行物理删除
disStockListDetailMapper.deleteInventoryByReservationId(reservationEntity.getId()); disStockListDetailMapper.deleteInventoryByReservationId(reservationEntity.getId());
} }
if (Func.isEmpty(distributionStockupInfoEntities)){ if (Func.isEmpty(distributionStockupInfoEntities)) {
//无备货信息 //无备货信息
//物理删除关于预约的所有信息 //物理删除关于预约的所有信息
distributionReservationStocklistMapper.deleteReservationStocklist(reservationEntity.getId()); distributionReservationStocklistMapper.deleteReservationStocklist(reservationEntity.getId());
@ -2228,26 +2227,26 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//该预约计划存在备货任务 //该预约计划存在备货任务
//查询备货任务 //查询备货任务
DistributionStockupEntity stockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntities.get(0).getStockupId()); DistributionStockupEntity stockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntities.get(0).getStockupId());
if (Func.isNotEmpty(stockupEntity)){ if (Func.isNotEmpty(stockupEntity)) {
if (stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue())){ if (stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue())) {
//物理删除关于预约的所有信息 //物理删除关于预约的所有信息
distributionReservationStocklistMapper.deleteReservationStocklist(reservationEntity.getId()); distributionReservationStocklistMapper.deleteReservationStocklist(reservationEntity.getId());
distributionReservationPackageMapper.deleteReservationPackage(reservationEntity.getId()); distributionReservationPackageMapper.deleteReservationPackage(reservationEntity.getId());
distributionReservationZeroPackageMapper.deleteByReservationId(reservationEntity.getId()); distributionReservationZeroPackageMapper.deleteByReservationId(reservationEntity.getId());
//备货任务未指派,此时对该备货任务进行删除,并且将该预约下的所有包件状态全部恢复 //备货任务未指派,此时对该备货任务进行删除,并且将该预约下的所有包件状态全部恢复
distributionStockupInfoMapper.deleteByReservationId(stockupEntity.getId(),reservationEntity.getId()); distributionStockupInfoMapper.deleteByReservationId(stockupEntity.getId(), reservationEntity.getId());
distributionReservationMapper.deleteByReservationId(reservationEntity.getId()); distributionReservationMapper.deleteByReservationId(reservationEntity.getId());
if (distributionStockupInfoEntities.size() == 1){ if (distributionStockupInfoEntities.size() == 1) {
distributionStockupMapper.deleteStockUpById(stockupEntity.getId()); distributionStockupMapper.deleteStockUpById(stockupEntity.getId());
} }
//这里直接进行物理删除即可,但是在删除前需要将数据状态进行维护 //这里直接进行物理删除即可,但是在删除前需要将数据状态进行维护
//处理预约的包件信息 //处理预约的包件信息
}else { } else {
reservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue()); reservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue());
this.updateById(reservationEntity); this.updateById(reservationEntity);
} }
}else { } else {
log.error("###################预约备货任务数据异常,备货任务ID:{}",distributionStockupInfoEntities.get(0).getStockupId()); log.error("###################预约备货任务数据异常,备货任务ID:{}", distributionStockupInfoEntities.get(0).getStockupId());
} }
} }
@ -2255,17 +2254,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
// DistributionStockupEntity stockupEntity = distributionReservationMapper.selectStockup(reservationEntity.getId()); // DistributionStockupEntity stockupEntity = distributionReservationMapper.selectStockup(reservationEntity.getId());
// if (Func.isEmpty(stockupEntity) || stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue())){ // if (Func.isEmpty(stockupEntity) || stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue())){
// if (Func.isNotEmpty(stockupEntity)){ // if (Func.isNotEmpty(stockupEntity)){
@ -2380,40 +2368,40 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId) .eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
ArrayList<DistributionParcelListVO> distributionParcelListVOS = new ArrayList<>(); ArrayList<DistributionParcelListVO> distributionParcelListVOS = new ArrayList<>();
if (Func.isNotEmpty(distributionReservationStockarticleEntityList)){ if (Func.isNotEmpty(distributionReservationStockarticleEntityList)) {
distributionReservationStockarticleEntityList.forEach(rs->{ distributionReservationStockarticleEntityList.forEach(rs -> {
if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda() List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, reservationId) .eq(DistributionReservationPackageEntity::getReservationId, reservationId)
.eq(DistributionReservationPackageEntity::getStockArticleId, rs.getStockArticleId()) .eq(DistributionReservationPackageEntity::getStockArticleId, rs.getStockArticleId())
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())); .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationPackageEntityList)){ if (Func.isNotEmpty(reservationPackageEntityList)) {
reservationPackageEntityList.forEach(rp->{ reservationPackageEntityList.forEach(rp -> {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId()); DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId());
DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity); DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity);
distributionParcelListVO.setReservationNum(parcelListEntity.getQuantity()); distributionParcelListVO.setReservationNum(parcelListEntity.getQuantity());
distributionParcelListVOS.add(distributionParcelListVO); distributionParcelListVOS.add(distributionParcelListVO);
}); });
}else { } else {
log.error("####################此预约下订单查询包件信息错误,订单ID为:{}",rs.getStockArticleId()); log.error("####################此预约下订单查询包件信息错误,订单ID为:{}", rs.getStockArticleId());
} }
}else if (rs.getIsZero().equals(IsOrNoConstant.yes.getValue())){ } else if (rs.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId) .eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, rs.getStockArticleId()) .eq(DistributionReservationZeroPackageEntity::getStockArticleId, rs.getStockArticleId())
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationZeroPackageEntities)){ if (Func.isNotEmpty(reservationZeroPackageEntities)) {
reservationZeroPackageEntities.forEach(rp->{ reservationZeroPackageEntities.forEach(rp -> {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParcelListId()); DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParcelListId());
DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity); DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity);
distributionParcelListVO.setReservationNum(rp.getQuantity()); distributionParcelListVO.setReservationNum(rp.getQuantity());
distributionParcelListVOS.add(distributionParcelListVO); distributionParcelListVOS.add(distributionParcelListVO);
}); });
}else { } else {
log.error("####################此预约下零担订单查询品类信息错误,订单ID为:{}",rs.getStockArticleId()); log.error("####################此预约下零担订单查询品类信息错误,订单ID为:{}", rs.getStockArticleId());
} }
}else { } else {
log.error("##################3预约订单isZero字段值错误,订单ID为:{}",rs.getStockArticleId()); log.error("##################3预约订单isZero字段值错误,订单ID为:{}", rs.getStockArticleId());
} }
}); });
@ -2437,7 +2425,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Override @Override
public List<DistributionStockupOrderListVO> selectStockupOrderList(Long reservationId, String isZero) { public List<DistributionStockupOrderListVO> selectStockupOrderList(Long reservationId, String isZero) {
return baseMapper.selectStockupOrderList(reservationId,isZero); return baseMapper.selectStockupOrderList(reservationId, isZero);
} }
@Override @Override
@ -2467,7 +2455,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
@Override @Override
public List<DistributionStockArticleVO> selectUpdateAvailableStockArticle(Long reservationId,Map<String, Object> distributionStockArticle) { public List<DistributionStockArticleVO> selectUpdateAvailableStockArticle(Long reservationId, Map<String, Object> distributionStockArticle) {
//这里还需要查询出该预约单下的订单信息 //这里还需要查询出该预约单下的订单信息
//这里将该预约下的订单进行过滤 //这里将该预约下的订单进行过滤
String orderCode = (String) distributionStockArticle.get("orderCode"); String orderCode = (String) distributionStockArticle.get("orderCode");
@ -2482,25 +2470,25 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationStockarticleEntityList.forEach(r -> { reservationStockarticleEntityList.forEach(r -> {
list.add(r.getStockArticleId().toString()); list.add(r.getStockArticleId().toString());
LambdaQueryWrapper<DistributionStockArticleEntity> lambda = Wrappers.<DistributionStockArticleEntity>query().lambda(); LambdaQueryWrapper<DistributionStockArticleEntity> lambda = Wrappers.<DistributionStockArticleEntity>query().lambda();
if (Func.isNotEmpty(orderCode)){ if (Func.isNotEmpty(orderCode)) {
lambda.like(DistributionStockArticleEntity::getOrderCode,orderCode); lambda.like(DistributionStockArticleEntity::getOrderCode, orderCode);
} }
if (Func.isNotEmpty(mallName)){ if (Func.isNotEmpty(mallName)) {
lambda.like(DistributionStockArticleEntity::getOrderCode,mallName); lambda.like(DistributionStockArticleEntity::getOrderCode, mallName);
} }
if (Func.isNotEmpty(descriptionGoods)){ if (Func.isNotEmpty(descriptionGoods)) {
lambda.like(DistributionStockArticleEntity::getOrderCode,descriptionGoods); lambda.like(DistributionStockArticleEntity::getOrderCode, descriptionGoods);
} }
if (Func.isNotEmpty(brand)){ if (Func.isNotEmpty(brand)) {
lambda.like(DistributionStockArticleEntity::getOrderCode,brand); lambda.like(DistributionStockArticleEntity::getOrderCode, brand);
} }
if (Func.isNotEmpty(customerName)){ if (Func.isNotEmpty(customerName)) {
lambda.like(DistributionStockArticleEntity::getOrderCode,customerName); lambda.like(DistributionStockArticleEntity::getOrderCode, customerName);
} }
if (Func.isNotEmpty(customerTelephone)){ if (Func.isNotEmpty(customerTelephone)) {
lambda.like(DistributionStockArticleEntity::getOrderCode,customerTelephone); lambda.like(DistributionStockArticleEntity::getOrderCode, customerTelephone);
} }
lambda.eq(DistributionStockArticleEntity::getId,r.getStockArticleId()); lambda.eq(DistributionStockArticleEntity::getId, r.getStockArticleId());
List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleService.getBaseMapper().selectList(lambda); List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleService.getBaseMapper().selectList(lambda);
List<DistributionStockArticleVO> stockArticleVOList = DistributionStockArticleWrapper.build().listVO(stockArticleEntities); List<DistributionStockArticleVO> stockArticleVOList = DistributionStockArticleWrapper.build().listVO(stockArticleEntities);
stockArticleVOList.forEach(s -> { stockArticleVOList.forEach(s -> {
@ -2525,23 +2513,23 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (!Func.isEmpty(list)) { if (!Func.isEmpty(list)) {
qw.notIn(DistributionStockArticleEntity::getId, list); qw.notIn(DistributionStockArticleEntity::getId, list);
} }
if (Func.isNotEmpty(orderCode)){ if (Func.isNotEmpty(orderCode)) {
qw.like(DistributionStockArticleEntity::getOrderCode,orderCode); qw.like(DistributionStockArticleEntity::getOrderCode, orderCode);
} }
if (Func.isNotEmpty(mallName)){ if (Func.isNotEmpty(mallName)) {
qw.like(DistributionStockArticleEntity::getOrderCode,mallName); qw.like(DistributionStockArticleEntity::getOrderCode, mallName);
} }
if (Func.isNotEmpty(descriptionGoods)){ if (Func.isNotEmpty(descriptionGoods)) {
qw.like(DistributionStockArticleEntity::getOrderCode,descriptionGoods); qw.like(DistributionStockArticleEntity::getOrderCode, descriptionGoods);
} }
if (Func.isNotEmpty(brand)){ if (Func.isNotEmpty(brand)) {
qw.like(DistributionStockArticleEntity::getOrderCode,brand); qw.like(DistributionStockArticleEntity::getOrderCode, brand);
} }
if (Func.isNotEmpty(customerName)){ if (Func.isNotEmpty(customerName)) {
qw.like(DistributionStockArticleEntity::getOrderCode,customerName); qw.like(DistributionStockArticleEntity::getOrderCode, customerName);
} }
if (Func.isNotEmpty(customerTelephone)){ if (Func.isNotEmpty(customerTelephone)) {
qw.like(DistributionStockArticleEntity::getOrderCode,customerTelephone); qw.like(DistributionStockArticleEntity::getOrderCode, customerTelephone);
} }
List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleService.getBaseMapper().selectList(qw); List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleService.getBaseMapper().selectList(qw);
List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList); List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleWrapper.build().listVO(stockArticleEntityList);
@ -2562,7 +2550,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.status(false); return R.status(false);
} }
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){ if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail("无仓库信息!!!"); return R.fail("无仓库信息!!!");
} }
@ -2612,18 +2600,18 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//存在订单的情况下才会对预约和包件的关系进行维护 //存在订单的情况下才会对预约和包件的关系进行维护
//选择了订单但是未进行包件的选择,默认选择了订单下的所有在库包件 //选择了订单但是未进行包件的选择,默认选择了订单下的所有在库包件
boolean flag = stockArticleList.stream().anyMatch(s -> s.getReservationStatus().equals(OrderReservationStatusConstant.yiyueyue.getValue())); boolean flag = stockArticleList.stream().anyMatch(s -> s.getReservationStatus().equals(OrderReservationStatusConstant.yiyueyue.getValue()));
if (flag){ if (flag) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error("预约选择订单被多次预约"); log.error("预约选择订单被多次预约");
return R.fail("订单已预约!!!"); return R.fail("订单已预约!!!");
} }
stockArticleList.forEach(s -> { stockArticleList.forEach(s -> {
DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class); DistributionStockArticleDTO stockArticleDTO = Func.copy(s, DistributionStockArticleDTO.class);
if (s.getIsZero().equals("0")){ if (s.getIsZero().equals("0")) {
WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(s.getWaybillNumber()); WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(s.getWaybillNumber());
if (Func.isNotEmpty(wayBillEntity)) { if (Func.isNotEmpty(wayBillEntity)) {
waybillId.add(wayBillEntity.getId().toString()); waybillId.add(wayBillEntity.getId().toString());
if (Func.isNotEmpty(wayBillEntity.getTakePhone())){ if (Func.isNotEmpty(wayBillEntity.getTakePhone())) {
marketPhone.add(wayBillEntity.getTakePhone()); marketPhone.add(wayBillEntity.getTakePhone());
} }
} }
@ -2661,12 +2649,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<DistributionParcelListDTO> packageList = s.getPackageListInfo(); List<DistributionParcelListDTO> packageList = s.getPackageListInfo();
if (Func.isEmpty(packageList)) { if (Func.isEmpty(packageList)) {
//添加订单下的所有在库订单的包件 //添加订单下的所有在库订单的包件
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId,s.getId()) List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId())
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()) .ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue()) .ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.notIn(DistributionParcelListEntity::getOrderPackageStatus,new String[]{OrderPackageStatusConstant.yichuku.getValue(),OrderPackageStatusConstant.yiqianshou.getValue()})); .notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
distributionParcelListEntities.forEach(p -> { distributionParcelListEntities.forEach(p -> {
if (p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){ if (p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) { if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity(); DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(reservationId); distributionReservationPackageEntity.setReservationId(reservationId);
@ -2691,8 +2679,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} else { } else {
//维护选中的包件信息 //维护选中的包件信息
packageList.forEach(p -> { packageList.forEach(p -> {
if (!p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){ if (!p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())){ if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity(); DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(reservationId); distributionReservationPackageEntity.setReservationId(reservationId);
distributionReservationPackageEntity.setParceListId(p.getId()); distributionReservationPackageEntity.setParceListId(p.getId());
@ -2729,7 +2717,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationStockarticleEntity.setIsHaveData(s.getIsHaveData()); distributionReservationStockarticleEntity.setIsHaveData(s.getIsHaveData());
distributionReservationStockarticleService.save(distributionReservationStockarticleEntity); distributionReservationStockarticleService.save(distributionReservationStockarticleEntity);
packageTotal.getAndAdd(distributionReservationStockarticleEntity.getReservationNum()); packageTotal.getAndAdd(distributionReservationStockarticleEntity.getReservationNum());
}else if (s.getIsZero().equals("1")){ } else if (s.getIsZero().equals("1")) {
//零担订单处理 //零担订单处理
DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity(); DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity();
if (Func.isNotBlank(s.getServiceNumber())) { if (Func.isNotBlank(s.getServiceNumber())) {
@ -2755,10 +2743,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS(); List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS();
AtomicInteger zeroPackageNum = new AtomicInteger(0); AtomicInteger zeroPackageNum = new AtomicInteger(0);
if (Func.isNotEmpty(parcelNumberVOS)){ if (Func.isNotEmpty(parcelNumberVOS)) {
//存在零担订单的包件信息 //存在零担订单的包件信息
parcelNumberVOS.forEach(p->{ parcelNumberVOS.forEach(p -> {
if (p.getReservationNum() > 0){ if (p.getReservationNum() > 0) {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setQuantity(p.getReservationNum()); distributionReservationZeroPackageEntity.setQuantity(p.getReservationNum());
distributionReservationZeroPackageEntity.setReservationId(reservationId); distributionReservationZeroPackageEntity.setReservationId(reservationId);
@ -2783,8 +2771,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// List<DistributionParcelNumberEntity> list = distributionParcelNumberService.list(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getStockArticleId, s.getId())); // List<DistributionParcelNumberEntity> list = distributionParcelNumberService.list(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getStockArticleId, s.getId()));
// List<DistributionParcelNumberVO> list = distributionParcelNumberMapper.selectZeroOrderPackageList(s.getId()); // List<DistributionParcelNumberVO> list = distributionParcelNumberMapper.selectZeroOrderPackageList(s.getId());
List<DistributionParcelNumberVO> list = distributionStockArticleService.getZeroOrderDetail(s.getId()); List<DistributionParcelNumberVO> list = distributionStockArticleService.getZeroOrderDetail(s.getId());
list.forEach(l->{ list.forEach(l -> {
if (l.getHandQuantity()>0){ if (l.getHandQuantity() > 0) {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity()); distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity());
distributionReservationZeroPackageEntity.setReservationId(reservationId); distributionReservationZeroPackageEntity.setReservationId(reservationId);
@ -2892,19 +2880,19 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
reservationEntity.setWarehouseName(String.join(",", warehouseNames)); reservationEntity.setWarehouseName(String.join(",", warehouseNames));
reservationEntity.setMallName(String.join(",", mallName)); reservationEntity.setMallName(String.join(",", mallName));
if (Func.isNotEmpty(storeName)){ if (Func.isNotEmpty(storeName)) {
reservationEntity.setStoreName(String.join(",", storeName)); reservationEntity.setStoreName(String.join(",", storeName));
} }
reservationEntity.setWaybillNo(String.join(",",waybillNo)); reservationEntity.setWaybillNo(String.join(",", waybillNo));
reservationEntity.setWaybillId(String.join(",",waybillId)); reservationEntity.setWaybillId(String.join(",", waybillId));
reservationEntity.setMailPhone(String.join(",",marketPhone)); reservationEntity.setMailPhone(String.join(",", marketPhone));
reservationEntity.setReceivingUnit(String.join(",",receivingUnit)); reservationEntity.setReceivingUnit(String.join(",", receivingUnit));
//统计数量 //统计数量
if (Func.isNotEmpty(reservationEntity.getOtherFee())){ if (Func.isNotEmpty(reservationEntity.getOtherFee())) {
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee()); BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee); reservationEntity.setFee(fee);
}else { } else {
reservationEntity.setFee(new BigDecimal(0)); reservationEntity.setFee(new BigDecimal(0));
} }
reservationEntity.setReservationCode(reservationMa()); reservationEntity.setReservationCode(reservationMa());
@ -2919,7 +2907,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
// reservationEntity.setReservationStatus(distributionReservationDTO.getReservationStatus()); // reservationEntity.setReservationStatus(distributionReservationDTO.getReservationStatus());
reservationEntity.setOrderSource(ReservationOrderSourceConstant.zijian.getValue()); reservationEntity.setOrderSource(ReservationOrderSourceConstant.zijian.getValue());
if (Func.isNotEmpty(distributionReservationDTO.getServeType())){ if (Func.isNotEmpty(distributionReservationDTO.getServeType())) {
reservationEntity.setServeType(distributionReservationDTO.getServeType()); reservationEntity.setServeType(distributionReservationDTO.getServeType());
} }
// reservationEntity.setReservationNum(stockArticleCount.get()); // reservationEntity.setReservationNum(stockArticleCount.get());
@ -2933,22 +2921,23 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
/** /**
* 自提查询库存数量 * 自提查询库存数量
*
* @param reservationId * @param reservationId
* @param stockListId * @param stockListId
* @return * @return
*/ */
@Override @Override
public Integer getReservationNumStockSelf(Long reservationId, Long stockListId) { public Integer getReservationNumStockSelf(Long reservationId, Long stockListId) {
return baseMapper.getReservationNumStockSelf(reservationId,stockListId); return baseMapper.getReservationNumStockSelf(reservationId, stockListId);
} }
@Override @Override
public List<DistributionParcelNumberVO> getReservationZeroOrderDetail(Long id,Long reservationId) { public List<DistributionParcelNumberVO> getReservationZeroOrderDetail(Long id, Long reservationId) {
List<DistributionParcelNumberVO> zeroOrderDetail = distributionStockArticleService.getZeroOrderDetail(id); List<DistributionParcelNumberVO> zeroOrderDetail = distributionStockArticleService.getZeroOrderDetail(id);
List<DistributionParcelNumberVO> parcelNumberVOS= baseMapper.selectReservationZeroOrderDetail(id,reservationId); List<DistributionParcelNumberVO> parcelNumberVOS = baseMapper.selectReservationZeroOrderDetail(id, reservationId);
Map<Long, DistributionParcelNumberVO> reservationNum = parcelNumberVOS.stream().collect(Collectors.toMap(DistributionParcelNumberVO::getParcelListId, Function.identity(), (k1, k2) -> k2)); Map<Long, DistributionParcelNumberVO> reservationNum = parcelNumberVOS.stream().collect(Collectors.toMap(DistributionParcelNumberVO::getParcelListId, Function.identity(), (k1, k2) -> k2));
zeroOrderDetail.forEach(z->{ zeroOrderDetail.forEach(z -> {
if (Func.isNotEmpty(reservationNum.get(z.getParcelListId()))){ if (Func.isNotEmpty(reservationNum.get(z.getParcelListId()))) {
z.setReservationNum(reservationNum.get(z.getParcelListId()).getReservationNum()); z.setReservationNum(reservationNum.get(z.getParcelListId()).getReservationNum());
} }
}); });

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java

@ -51,6 +51,9 @@ public class TaskSearchDTO {
@ApiModelProperty(value = "托盘ID") @ApiModelProperty(value = "托盘ID")
private Long trayId; private Long trayId;
/** /**
* type * type
*/ */

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -1043,8 +1043,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
positionCode = goodsAreaEntity.getHeadline() + "-" + basicdataGoodsShelfEntity.getGoodsShelfName() + "-" + goodsAllocationEntity.getGoodsAllocationName(); positionCode = goodsAreaEntity.getHeadline() + "-" + basicdataGoodsShelfEntity.getGoodsShelfName() + "-" + goodsAllocationEntity.getGoodsAllocationName();
} }
} }
QuestDetailDTO questDetail = taskSearchDTO.getQuestDetail(); QuestDetailDTO questDetail = taskSearchDTO.getQuestDetail();
QuestDetailEntity questDetailEntity = new QuestDetailEntity(); QuestDetailEntity questDetailEntity = new QuestDetailEntity();
BeanUtil.copy(questDetail, questDetailEntity); BeanUtil.copy(questDetail, questDetailEntity);
@ -1132,6 +1130,9 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
packagelistVO.setMaterialName(questDetailEntity.getMaterialName()); packagelistVO.setMaterialName(questDetailEntity.getMaterialName());
} }
packagelistVO.setAllocation(questDetailEntity.getPositionCode()); packagelistVO.setAllocation(questDetailEntity.getPositionCode());
packagelistVO.setQuestDetailId(questDetailEntity.getId());
packagelistVO.setQuestStatus(questDetailEntity.getQuestStatus());
packagelistVO.setQuestTarget(questDetailEntity.getQuestTarget());
packagelistVO.setOrderCode(orderCode.get(0)); packagelistVO.setOrderCode(orderCode.get(0));
packagelistVO.setCurrentStatus("1"); // 默认在库 packagelistVO.setCurrentStatus("1"); // 默认在库
taskPackagelistVOS.add(packagelistVO); taskPackagelistVOS.add(packagelistVO);
@ -1273,7 +1274,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
.eq(QuestDetailEntity::getQuestId, taskQuestId) .eq(QuestDetailEntity::getQuestId, taskQuestId)
.like(QuestDetailEntity::getOrderCode, incomingBatch) .like(QuestDetailEntity::getOrderCode, incomingBatch)
.eq(QuestDetailEntity::getQuestType, 3) .eq(QuestDetailEntity::getQuestType, 3)
.eq(QuestDetailEntity::getQuestTarget, 1) .in(QuestDetailEntity::getQuestTarget, 1,2)
.eq(QuestDetailEntity::getWarehouseId, taskSearchDTO.getWarehouseId())); .eq(QuestDetailEntity::getWarehouseId, taskSearchDTO.getWarehouseId()));
if (Func.isNotEmpty(questDetailEntityList) && questDetailEntityList.size()>0){ if (Func.isNotEmpty(questDetailEntityList) && questDetailEntityList.size()>0){
TaskContractVO taskContractVO = new TaskContractVO(); TaskContractVO taskContractVO = new TaskContractVO();
@ -1344,6 +1345,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
} }
}); });
taskContractVO.setZktotal(libNum.get()); taskContractVO.setZktotal(libNum.get());
taskContractVO.setIsZero(0);
taskContractVO.setIsInventory(0);
} else { } else {
//查询任务表 是否需要进行盘点任务数据的插入 //查询任务表 是否需要进行盘点任务数据的插入
List<QuestDetailEntity> zeroQuestDetailEntityList = questDetailService.list(Wrappers.<QuestDetailEntity>query().lambda() List<QuestDetailEntity> zeroQuestDetailEntityList = questDetailService.list(Wrappers.<QuestDetailEntity>query().lambda()
@ -1395,6 +1398,9 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailEntity.setStockNum(stockArticleInfo.getHandQuantity()); questDetailEntity.setStockNum(stockArticleInfo.getHandQuantity());
questDetailEntity.setQuestType(3); questDetailEntity.setQuestType(3);
questDetailService.save(questDetailEntity); questDetailService.save(questDetailEntity);
taskContractVO.setIsZero(1);
taskContractVO.setIsInventory(0);
taskContractVOS.add(taskContractVO);
} }
} }
} }

Loading…
Cancel
Save