Browse Source

装车零担BUG修复、回库任务扫描日志记录

dist.1.3.0
汤建军 6 months ago
parent
commit
512ccede25
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  2. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListDetailVO.java
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  5. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  7. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  9. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  10. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStockarticleServiceImpl.java
  11. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java
  12. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  13. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -260,5 +260,5 @@ public interface IDistributionParcelListClient {
* @return
*/
@GetMapping(API_PREFIX + "/clearWaybillInfoByParceListIds")
boolean maintainInWarehouse(@RequestParam("orderPackageId") Long orderPackageId);
boolean maintainInWarehouse(@RequestParam("orderPackageId") Long orderPackageId,@RequestParam("taskCode") String taskCode);
}

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

@ -35,6 +35,8 @@ public class DisStockListDetailVO extends DisStockListDetailEntity {
private String signingStatusName;
private String orderPackageCode;
private String signingUser;
private String loadingUser;

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

@ -562,7 +562,7 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
}
@Override
public boolean maintainInWarehouse(Long orderPackageId) {
return distributionParcelListService.maintainInWarehouse(orderPackageId);
public boolean maintainInWarehouse(Long orderPackageId,String taskCode) {
return distributionParcelListService.maintainInWarehouse(orderPackageId,taskCode);
}
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java

@ -467,4 +467,12 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @return
*/
List<DistributionLoadscanAbnormalVO> selectNewAbnormalPackageList(@Param("reservationId")Long reservationId,@Param("deliveryId") Long deliveryId);
/**
* 进行签收数量扣减
* @param deliveryId
* @param reservationId
* @param nub
*/
void deductionSignforPacjageNum(@Param("deliveryId")Long deliveryId,@Param("reservationId") Long reservationId,@Param("nub") int nub);
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -85,6 +85,11 @@
lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loaded_number !=0 and lds.delivery_id =
#{deliveryId}
</update>
<update id="deductionSignforPacjageNum">
UPDATE logpm_distribution_signfor lds set lds.received_quantity = ( lds.received_quantity - #{nub} ) WHERE
lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loaded_number !=0 and lds.delivery_id =
#{deliveryId}
</update>
<update id="deductionLoadingInventoryNum">
UPDATE logpm_distribution_signfor lds set lds.loadedin_number = ( lds.loadedin_number - #{nub} ) WHERE
lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loadedin_number !=0 and lds.delivery_id =
@ -1979,7 +1984,9 @@
logpm_distribution_delivery_list lddl
LEFT JOIN logpm_distribution_delivery_self ldds ON lddl.id = ldds.delivery_id
WHERE
lddl.is_deleted = 0 AND lddl.warehouse_id = #{param.warehouseId}
lddl.is_deleted = 0
AND lddl.warehouse_id = #{param.warehouseId}
AND lddl.type = #{param.type}
<if test="deliveryIds != null ">
and lddl.id in
<foreach collection="deliveryIds" item="item" open="(" close=")" separator=",">

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

@ -281,5 +281,5 @@ public interface IDistributionParcelListService extends BaseService<Distribution
* @param orderPackageId
* @return
*/
boolean maintainInWarehouse(Long orderPackageId);
boolean maintainInWarehouse(Long orderPackageId,String taskCode);
}

33
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -447,7 +447,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionDeliveryListVO.setReservationList(customList);
//查询司机信息
if (Objects.equals(distributionDeliveryListVO.getKind(), "1")) {
List<DistributionDeliverySelfEntity> deliverySelfServices = distributionDeliverySelfService.list(Wrappers.<DistributionDeliverySelfEntity>query().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId()).eq(DistributionDeliverySelfEntity::getIsMaster, 2));
List<DistributionDeliverySelfEntity> deliverySelfServices = distributionDeliverySelfService.list(Wrappers.<DistributionDeliverySelfEntity>query().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId())
// .eq(DistributionDeliverySelfEntity::getIsMaster, 2)
);
if (!deliverySelfServices.isEmpty()) {
StringBuffer sb1 = new StringBuffer();
@ -1463,12 +1466,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
public R oneloading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
boolean falg = true;
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "请选择仓库!!");
// throw n/**/ew CustomerException(403, "仓库信息不能为空");
}
if (falg) {
return Resp.scanFail("功能维护中...","功能维护中...");
}
/*
1. 通过查询这个所有的预约单
2.通过预约单ID 得到所有的订单
@ -8337,7 +8344,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (isSatisfy) {
//本车次的异常装车
DistributionLoadscanEntity distributionLoadscanEntity = loadscanEntityList.get(0);
if (distributionLoadscanEntity.equals("2")) {
if (distributionLoadscanEntity.getIsAbnormalSigning().equals("2")) {
//进行异常签收的标识
//存在装车数据
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
@ -8830,7 +8837,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error(method + "参数缺失ParcelListDTOS");
return Resp.fail("参数缺失,请联系管理员");
}
if (DeliveryStartStatusConstant.yifache.equals(deliveryListEntity.getIsStart())) {
if (DeliveryStartStatusConstant.yifache.getValue().equals(deliveryListEntity.getIsStart())) {
return Resp.scanFail("已发车无法进行零担装车", "已发车无法进行零担装车");
}
List<DistributionParcelNumberDTO> parcelListDTOS = distrilbutionloadingscanDTO.getParcelListDTOS();
@ -8850,7 +8857,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionReservationStockarticleEntity reservationStockarticleEntity = reservationStockarticleEntityList.get(0);
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda().
eq(DistributionReservationZeroPackageEntity::getReservationId, reservationStockarticleEntity.getReservationId()).
eq(DistributionReservationZeroPackageEntity::getStockArticleId, distrilbutionloadingscanDTO.getOrderId()).
in(DistributionReservationZeroPackageEntity::getStockArticleId, reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList())).
ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationZeroPackageEntityList)) {
//查询零担订单品类信息
@ -8864,7 +8871,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Map<Long, DistributionParcelNumberEntity> zeroPackageMap = parcelNumberEntityList.stream().collect(Collectors.toMap(DistributionParcelNumberEntity::getParcelListId, Function.identity(), (k1, k2) -> k2));
List<Long> operationZeroPackageIds = parcelListDTOS.stream().map(DistributionParcelNumberDTO::getParcelListId).collect(Collectors.toList());
//查询是否已经有装车数据了
List<DistributionLoadscanEntity> zeroLoadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, reservationStockarticleEntity.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntity.getStockArticleId()).in(DistributionLoadscanEntity::getPackageId, operationZeroPackageIds).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
List<DistributionLoadscanEntity> zeroLoadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.in(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()))
.in(DistributionLoadscanEntity::getPackageId, operationZeroPackageIds)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
Map<Long, List<DistributionLoadscanEntity>> loadMap = null;
if (Func.isNotEmpty(zeroLoadscanEntityList)) {
loadMap = zeroLoadscanEntityList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId));
@ -8882,7 +8893,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
if (Func.isNotEmpty(loadMap)) {
List<DistributionLoadscanEntity> loadscanEntities = loadMap.get(parcelListDTO.getParcelListId());
if (Func.isNotEmpty(loadscanEntities)) {
int sum = loadscanEntities.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
distributionSignforMapper.deductionLoadingPacjageNum(distrilbutionloadingscanDTO.getReservationId(),distrilbutionloadingscanDTO.getDeliveryId(),sum);
if (parcelListDTO.getLoadingNum() <= reservationZeroPackageEntity.getQuantity()) {
//零担修改装车
DistributionLoadscanEntity zeroLoadscanEntity = loadscanEntities.get(0);
@ -9470,6 +9484,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
@Transactional
public R cancelAbnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
String method = "########################DistributionDeliveryServiceImppl.cancelAbnormalLoading";
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())) {
@ -9886,8 +9901,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getDeliveryId, loadscanEntity.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, loadscanEntity.getReservationId()));
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber());
signforEntity.setLoadedNumber(loadedNumber.add(loadedNum).subtract(loadedNub).intValue());
distributionSignforService.updateById(signforEntity);
// signforEntity.setLoadedNumber(loadedNumber.add(loadedNum).subtract(loadedNub).intValue());
// distributionSignforService.updateById(signforEntity);
loadscanEntity.setLoadedNub(parcelListDTO.getLoadingNum());
loadscanEntity.setPackageNub(parcelListDTO.getLoadingNum());
@ -9912,8 +9927,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscanService.save(zeroLoadscanEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(zeroLoadscanEntity.getDeliveryId(), zeroLoadscanEntity.getReservationId(), zeroLoadscanEntity.getPackageNub());
// //更新装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(zeroLoadscanEntity.getDeliveryId(), zeroLoadscanEntity.getReservationId(), zeroLoadscanEntity.getPackageNub());
//维护零担品类的数量
DistributionParcelNumberEntity parcelNumberEntity = zeroPackageMap.get(parcelNumberDTO.getParcelListId());
parcelNumberEntity.setOutboundQuantity(parcelNumberEntity.getOutboundQuantity() + parcelNumberDTO.getLoadingNum());

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

@ -1430,7 +1430,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Override
@Transactional
public boolean maintainInWarehouse(Long orderPackageId) {
public boolean maintainInWarehouse(Long orderPackageId,String taskCode) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
DistributionParcelListEntity parcelListEntity = this.getById(orderPackageId);
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
@ -1439,7 +1439,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
boolean update = this.updateById(parcelListEntity);
//维护订单
distributionStockArticleService.maintenanceOrderMall(parcelListEntity.getStockArticleId()+"");
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"扫描回库,回库原因:"+"异常拒签";
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"扫描回库,回库任务号:"+taskCode;
//进行日志添加
List<JSONObject> logList = new ArrayList<>();
JSONObject logJS = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_FAIL.getCode());

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

@ -27,16 +27,7 @@ import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.DistributionCancelReservationPackageDTO;
import com.logpm.distribution.dto.DistributionDeliveryAllocationDTO;
import com.logpm.distribution.dto.DistributionDeliverySelfDTO;
import com.logpm.distribution.dto.DistributionDeliveryTripartiteDTO;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.logpm.distribution.dto.DistributionReservationDTO;
import com.logpm.distribution.dto.DistributionReservationPackageDTO;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.DistributionStockListDTO;
import com.logpm.distribution.dto.DistributionStockupDTO;
import com.logpm.distribution.dto.*;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.mapper.DisStockListDetailMapper;
@ -86,6 +77,7 @@ import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStartStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
@ -1467,6 +1459,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setTaskTime(taskTime);
distributionDeliveryListEntity.setDeliveryNumber(packageNum.get());
distributionDeliveryListEntity.setInventoryNub(inventoryNum.get());
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.daifache.getValue());
distributionDeliveryListService.updateById(distributionDeliveryListEntity);
String content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getUser().getNickName() + "转车次任务,操作方式:批量预约任务转配送,车次号:" + distributionDeliveryListEntity.getTrainNumber();
distributionAsyncService.recordsReservationDeliveryLog(reservationEntityList, myCurrentWarehouse, user, distributionDeliveryListEntity, WorkNodeEnums.PLAN_DISTRIBUTION.getCode(), content);
@ -2678,6 +2671,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setCustomersNumber(clientTotal.get());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.daifache.getValue());
distributionDeliveryListService.updateById(distributionDeliveryListEntity);
//推送信息至运单追中日志
if (!aaa.isEmpty()) {
@ -3968,17 +3962,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
public void maintenanceReservationNum(Long reservationId) {
DistributionReservationEntity reservationEntity = this.getById(reservationId);
if (Func.isNotEmpty(reservationEntity)) {
int sum = 0;
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (Func.isNotEmpty(distributionParcelListEntities)) {
int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
reservationEntity.setReservationNum(sum);
} else {
reservationEntity.setReservationNum(0);
sum += distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
}
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(reservationId);
if (Func.isNotEmpty(distributionParcelNumberDTOS)) {
sum += distributionParcelNumberDTOS.stream().mapToInt(DistributionParcelNumberDTO::getReservationNum).sum();
}
reservationEntity.setReservationNum(sum);
int iSum = 0;
List<DistributionReservationStocklistEntity> reservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationId);
if (Func.isNotEmpty(reservationStocklistEntities)) {
int sum = reservationStocklistEntities.stream().mapToInt(DistributionReservationStocklistEntity::getReservationNum).sum();
reservationEntity.setReservationStockListNum(sum);
iSum = reservationStocklistEntities.stream().mapToInt(DistributionReservationStocklistEntity::getReservationNum).sum();
reservationEntity.setReservationStockListNum(iSum);
} else {
reservationEntity.setReservationStockListNum(0);
}
@ -3988,7 +3986,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
log.info("#################系统判定取消预约任务:{}", reservationEntity.getReservationCode());
distributionReservationDTO.setCancelReason("无效配送任务,系统取消");
this.cancelReservation(distributionReservationDTO);
} else {
this.updateById(reservationEntity);
}

31
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStockarticleServiceImpl.java

@ -129,17 +129,28 @@ public class DistributionReservationStockarticleServiceImpl extends BaseServiceI
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(reservationStockarticleEntity)) {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, orderId, warehouseId);
if (Func.isNotEmpty(distributionParcelListEntities)) {
int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
reservationStockarticleEntity.setReservationNum(sum);
} else {
reservationStockarticleEntity.setReservationNum(0);
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
reservationStockarticleEntity.setCancelStatus(1);
}
if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())){
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, orderId, warehouseId);
if (Func.isNotEmpty(distributionParcelListEntities)) {
int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
reservationStockarticleEntity.setReservationNum(sum);
} else {
reservationStockarticleEntity.setReservationNum(0);
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
reservationStockarticleEntity.setCancelStatus(1);
}
}else {
List<DistributionParcelNumberVO> distributionParcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(orderId,reservationId);
if (!distributionParcelNumberVOS.isEmpty()) {
int sum = distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getReservationNum).sum();
reservationStockarticleEntity.setReservationNum(sum);
}else {
reservationStockarticleEntity.setReservationNum(0);
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
reservationStockarticleEntity.setCancelStatus(1);
}
}
this.updateById(reservationStockarticleEntity);
}
}

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

@ -29,6 +29,7 @@ import com.logpm.distribution.mapper.DistributionReservationZeroPackageMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionReservationZeroPackageVO;
import io.jsonwebtoken.lang.Objects;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -47,6 +48,7 @@ import java.util.List;
* @since 2023-10-08
*/
@Service
@Slf4j
public class DistributionReservationZeroPackageServiceImpl extends BaseServiceImpl<DistributionReservationZeroPackageMapper, DistributionReservationZeroPackageEntity> implements IDistributionReservationZeroPackageService {
@ -154,6 +156,7 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
);
if (!Func.isNull(one)){
if (one.getQuantity() == 0) {
log.info("当前查询数量>>>>>>>>>one.getQuantity():{}",one.getQuantity());
one.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
this.updateById(one);
}

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -6500,7 +6500,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.info("==========回显图片的值:{}", distributionSignfor);
List<DistributionSignPrintEntity> list = iDistributionSignPrintService.list(Wrappers.<DistributionSignPrintEntity>query().lambda()
.eq(DistributionSignPrintEntity::getReservationId, distributionSignfor.getReservationId())
.eq(DistributionSignPrintEntity::getIsDeleted, "0")
);
Map<String, List<DistributionSignPrintEntity>> collect = list.stream().collect(Collectors.groupingBy(DistributionSignPrintEntity::getType));
@ -7913,7 +7912,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(loadingMap)) {
//存在装车数据,进行是否签收判断
List<DistributionLoadscanEntity> entityList = loadingMap.get(parcelNumberDTO.getParcelListId());
if (entityList.size() == 1) {
int sum = entityList.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum();
//进行已签收数量扣减
distributionSignforMapper.deductionSignforPacjageNum(deliveryId,reservationId,sum);
DistributionLoadscanEntity distributionLoadscanEntity = entityList.get(0);
if (parcelNumberDTO.getSigningNum() > distributionReservationZeroPackageEntity.getQuantity()) {
//存在配置要求必须装车才能进行签收
@ -7924,12 +7927,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
int a = 0;
if (distributionLoadscanEntity.getLoadedNub() < parcelNumberDTO.getSigningNum()) {
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isStrictLoading) {
return Resp.scanFail("装车数量少于签收数,无法签收", "装车数量少于签收数,无法签收");
}
//将装车和签收进行统一数量
distributionLoadscanEntity.setLoadedNub(parcelNumberDTO.getSigningNum());
distributionLoadscanEntity.setPackageNub(parcelNumberDTO.getSigningNum());
a = parcelNumberDTO.getSigningNum() - distributionLoadscanEntity.getLoadedNub();
}
deliveryNumber = distributionParcelNumberEntity.getDeliveryQuantity() + distributionLoadscanEntity.getReceivedQuantity() - parcelNumberDTO.getSigningNum();
handQuantity = distributionParcelNumberEntity.getHandQuantity() + distributionLoadscanEntity.getReceivedQuantity() - parcelNumberDTO.getSigningNum();
outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() - distributionLoadscanEntity.getReceivedQuantity() + parcelNumberDTO.getSigningNum();
@ -7948,6 +7953,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
receivedQuantity += parcelNumberDTO.getSigningNum();
//进行签收数量的统计
distributionLoadscanService.updateById(distributionLoadscanEntity);
distributionSignforMapper.updateSignforNum(deliveryId,reservationId,distributionLoadscanEntity.getReceivedQuantity());
pushList.add(distributionLoadscanEntity);
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", zeroParcelListEntity.getOrderCode());
@ -7963,7 +7969,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} else {
//存在配置要求必须装车才能进行签收
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isStrictLoading) {
return Resp.scanFail("包件未装车,无法签收", "包件未装车,无法签收");
return Resp.scanFail("零担未装车,无法签收", "零担未装车,无法签收");
}
//签收装车数据一起进行补录
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
@ -8007,6 +8013,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setOneQclick(2);
loadscanEntity.setSigningTime(now);
distributionLoadscanService.save(loadscanEntity);
//维护签收数量
distributionSignforMapper.updateSignforNum(deliveryId,reservationId,loadscanEntity.getReceivedQuantity());
pushList.add(loadscanEntity);
loadedNumber += loadscanEntity.getLoadedNub();
receivedQuantity += loadscanEntity.getReceivedQuantity();
@ -8024,6 +8032,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("remark", "签收下架");
jsonObjects.add(jsonObject);
warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
}
//维护订单
if (outboundQuantity.equals(distributionParcelNumberEntity.getQuantity())) {
@ -8453,16 +8462,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
});
distributionAppStockArticleVO.setDistributionParcelNumberVOS(parcelNumberVOS);
distributionAppStockArticleVO.setSignforNub(parcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getSigningNum).sum());
}
}
zeroOrderList.add(distributionAppStockArticleVO);
}
}
}
List<DisStockListDetailVO> inventoryPackageList = baseMapper.selectAppDeliveryInventoryPackage(reservationId);
if (!orderList.isEmpty()) {
reservationAppDetailVO.setOrderList(orderList);
@ -8472,7 +8477,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
if (!inventoryPackageList.isEmpty()) {
reservationAppDetailVO.setInventoryList(inventoryPackageList);
}
return R.data(reservationAppDetailVO);
}
@ -8745,16 +8749,29 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Objects.isNull(distributionSignfor.getReservationId())){
log.error(method+"参数缺失:ReservationId");
}
//查询签收数据
BasicdataWarehouseEntity warehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(warehouse)){
log.error(method+"查询签收信息错误reservationId:{}",distributionSignfor.getReservationId());
}
Integer isStrictLoading = 0;
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouse.getId());
if (!Objects.isNull(warehouseConfig.getIsStrictLoading())){
isStrictLoading = warehouseConfig.getIsStrictLoading();
}
//查询签收数据
DistributionSignforEntity signforEntity = baseMapper.getByReservationId(distributionSignfor.getReservationId());
if (Objects.isNull(signforEntity)){
log.error(method+"查询签收信息错误reservationId:{}",distributionSignfor.getReservationId());
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(signforEntity.getDeliveryId());
if (Objects.isNull(deliveryListEntity)){
log.error(method+"查询签收信息错误reservationId:{}",distributionSignfor.getReservationId());
}
Map<String, List<DistributionSignPrintEntity>> prices = new HashMap<>();
prices = this.prices(distributionSignfor);
if (deliveryListEntity.getKind().equals("1")) {
BladeUser user = AuthUtil.getUser();
Boolean driver = distributionDeliveryListService.judgeIsDriver(user);
@ -8765,12 +8782,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (deliverySelfEntity == null){
return Resp.scanFail("当前人无操作权限","当前人无操作权限");
}
prices = this.getPricesByDriver(distributionSignfor,deliverySelfEntity);
}else {
prices = this.prices(distributionSignfor);
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isStrictLoading){
prices = this.getPricesByDriver(distributionSignfor,deliverySelfEntity);
}
}
DistributionSignforEntity one1 = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId())
);

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -464,9 +464,9 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
warehouseRetentionScanEntity.getOrderPackageId(),
warehouseRetentionScanEntity.getConditions())
);
}else {
saveFlah.set(distributionParcelListClient.maintainInWarehouse(warehouseRetentionScanEntity.getOrderPackageId()));
}
saveFlah.set(distributionParcelListClient.maintainInWarehouse(warehouseRetentionScanEntity.getOrderPackageId(),warehouseRetentionScanEntity.getTaskCode()));
break;
case 2:
//回库指定数量的零担包件

Loading…
Cancel
Save