Browse Source

异常操作增加驳回判断、已签订单日志打印

master
汤建军 7 months ago
parent
commit
5346f411be
  1. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  2. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  4. 32
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  5. 56
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -596,8 +596,14 @@ public class DistributionStockArticleController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "已签收订单", notes = "传入distributionStockArticle")
public R<IPage<DistributionSignforStockArticleVO>> signforList(@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle, Query query) {
IPage<DistributionSignforStockArticleVO> pages = distributionStockArticleService.pageSignforListtOwe(Condition.getPage(query), distributionStockArticle);
return R.data(pages);
try {
IPage<DistributionSignforStockArticleVO> pages = distributionStockArticleService.pageSignforListtOwe(Condition.getPage(query), distributionStockArticle);
return R.data(pages);
}catch (Exception e){
log.error("已签订单错误e:{}",e);
}
return R.data(null);
}

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

@ -16,11 +16,9 @@
*/
package com.logpm.distribution.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.DistributionLoadingNumDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
@ -496,8 +494,9 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
/**
* 检查配送任务是否进行发车
* @param deliveryListEntityId
* @return
*/
Boolean checkDeliveryStart(@Param("deliveryId")Long deliveryId);
}

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

@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionDeliveryExcelDTO;
import com.logpm.distribution.dto.DistributionDeliveryInfoDTO;
import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
@ -257,7 +256,6 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
/**
* 查询托盘详情
* @param page
* @param distributionDeliveryList
* @return
*/
@ -465,6 +463,8 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
/**
* 查询签收预约客户包件信息
* @param reservationId

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

@ -676,6 +676,19 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String collect = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(","));
log.info("包件已在其他车次存在异常 >>>>当前车次:{},其他车次:{}", distributionDeliveryListEntity.getTrainNumber(), collect);
return Resp.scanFail("包件已在其他车次存在异常", "包件已在其他车次存在异常");
}else {
//这里需要判定文员是否对该异常进行驳回操作
List<DistributionLoadscanAbnormalEntity> collect = abnormalEntities.stream().filter(f -> distributionDeliveryListEntity.getId().equals(f.getDeliveryListId()) && distrilbutionloadingscanDTO.getReservationId().equals(f.getReservationId())).collect(Collectors.toList());
if (!collect.isEmpty()) {
//存在异常操作
if (collect.size() == 1){
//判断是否进行审核以及驳货操作
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = collect.get(0);
if (distributionLoadscanAbnormalEntity.getAuditingStatus().equals(3)){
return Resp.scanFail("包件异常已驳回", "包件异常已驳回");
}
}
}
}
}
@ -5879,14 +5892,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public R retentionScan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
if (distrilbutionloadingscanDTO.getBarcode().isEmpty()) {
log.error("参数缺失Barcode:{}",distrilbutionloadingscanDTO.getBarcode());
}
Integer retentionType = distrilbutionloadingscanDTO.getRetentionType();
DistributionDeliveryListEntity deliveryListEntity = this.getById(distrilbutionloadingscanDTO.getDeliveryId());
List<DistributionRetentionScanVo> retentionScanVos = new ArrayList<>();
//查询包件
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
return Resp.scanFail("未授权!!!","未授权!!!");
}
switch (retentionType) {
case 1:
//包件--库存品 和包件
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
@ -5896,6 +5916,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//包件存在装车才能进行滞留
//通过配送任务和包件确定预约信息
DistributionLoadscanEntity distributionLoadscanEntity = loadscanEntityList.get(0);
if (2 == distributionLoadscanEntity.getIsAbnormalLoading()){
//异常装车未进行审核
return Resp.scanFail("包件存在异常", "包件存在异常");
}
if (2 == distributionLoadscanEntity.getSignforState()) {
log.info("滞留扫描失败,包件已签收>>>>>>>>>>>>>>>>>>>>>>>reservationId:{},packageCode:{}", distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getOrderPackageCode());
return Resp.scanFail("包件已签收", "包件已签收");
@ -5905,7 +5929,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
} else {
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
@ -5953,7 +5976,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("包件未装车", "包件未装车");
} else {
//该配送任务查询无该包件信息
return Resp.scanFail("此配送无该包件", "此配送无该包件信息");
return Resp.scanFail("系统无编码", "系统无编码");
}
}
@ -7638,6 +7661,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
@Transactional
public void maintenanceDeliveryInfo(Long deliveryId) {

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

@ -2506,6 +2506,19 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
String info = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(","));
log.info("包件已在其他车次存在异常 >>>>当前车次:{},其他车次:{}",deliveryListEntity.getTrainNumber(),info);
return Resp.scanFail("包件已在其他车次存在异常", "包件已在其他车次存在异常");
}else {
//这里需要判定文员是否对该异常进行驳回操作
List<DistributionLoadscanAbnormalEntity> LoadscanAbnormalEntityList = abnormalEntities.stream().filter(f -> deliveryListEntity.getId().equals(f.getDeliveryListId()) && distrilbutionloadingscanDTO.getReservationId().equals(f.getReservationId())).collect(Collectors.toList());
if (!LoadscanAbnormalEntityList.isEmpty()) {
//存在异常操作
if (LoadscanAbnormalEntityList.size() == 1){
//判断是否进行审核以及驳货操作
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = LoadscanAbnormalEntityList.get(0);
if (distributionLoadscanAbnormalEntity.getAuditingStatus().equals(3)){
return Resp.scanFail("包件异常已驳回", "包件异常已驳回");
}
}
}
}
//判断具体的装车信息
}
@ -6521,28 +6534,32 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//存在异常列表
//进行异常列表的清理
for (DistributionLoadscanAbnormalEntity abnormalEntity : abnormalEntities) {
abnormalEntity.setAuditingStatus(3);
abnormalEntity.setAuditingUser(AuthUtil.getNickName());
abnormalEntity.setAuditingTime(new Date());
abnormalEntity.setIsDeleted(1);
updateList.add(abnormalEntity);
//收集需要进行维护的包件
packageIdList.add(abnormalEntity.getPackageId());
//查询是否进行签收
//存在异常操作为进行审核操作才可进行驳回
if (Objects.isNull(abnormalEntity.getAuditingStatus())){
//驳回视为进行审核,审核结果为驳回
abnormalEntity.setAuditingStatus(3);
abnormalEntity.setAuditingUser(AuthUtil.getNickName());
abnormalEntity.setAuditingTime(new Date());
updateList.add(abnormalEntity);
//收集需要进行维护的包件
packageIdList.add(abnormalEntity.getPackageId());
//查询是否进行签收
// 统计需要进行扣减的签收数量
if (Func.isNotEmpty(loadscanMap.get(abnormalEntity.getPackageId()))){
//获取装车记录
DistributionLoadscanEntity distributionLoadscanEntity = loadscanMap.get(abnormalEntity.getPackageId());
orderIds.add(distributionLoadscanEntity.getOrderId());
if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
signforNum++;
if (Func.isNotEmpty(loadscanMap.get(abnormalEntity.getPackageId()))){
//获取装车记录
DistributionLoadscanEntity distributionLoadscanEntity = loadscanMap.get(abnormalEntity.getPackageId());
orderIds.add(distributionLoadscanEntity.getOrderId());
if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
signforNum++;
}
}else {
//异常驳回无装车记录
log.error(method+"异常驳回无装车记录");
throw new RuntimeException("异常驳货列表存在无装车信息");
}
}else {
//异常驳回无装车记录
log.error(method+"异常驳回无装车记录");
throw new RuntimeException("异常驳货列表存在无装车信息");
loadingNum++;
}
loadingNum++;
}
}
//进行装车记录的统计
@ -6557,7 +6574,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.set(DistributionParcelListEntity::getOrderPackageStatus,OrderPackageStatusConstant.yiruku.getValue())
.set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.daibeihuo.getValue())
);
//维护相关的订单信息
distributionStockArticleService.maintenanceOrderInfoByIds(orderIds);
return R.success("异常驳回成功");

Loading…
Cancel
Save