Browse Source

异常拒签回库维护包件回库状态

dist.1.3.0
汤建军 6 months ago
parent
commit
e4a080d569
  1. 7
      blade-biz-common/src/main/java/org/springblade/common/constant/retention/RetentionTypeConstant.java
  2. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  3. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionLoadscanAbnormalVO.java
  4. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java
  5. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  7. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  8. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  9. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  10. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  11. 72
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  12. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

7
blade-biz-common/src/main/java/org/springblade/common/constant/retention/RetentionTypeConstant.java

@ -7,10 +7,9 @@ package org.springblade.common.constant.retention;
*/
public enum RetentionTypeConstant {
zhuangchezhiliu("装车滞留",1),
peisongzhiliu("配送滞留",2),
chukuzhiliu("出库滞留",3),
quxiaozhiliu("取消滞留",4);
zizhuxinzeng("自主新增",1),
yichangbohui("异常驳回",2),
yichangjuqian("异常拒签",3);
/**

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

@ -253,4 +253,12 @@ public interface IDistributionParcelListClient {
@PostMapping(API_PREFIX + "/clearWaybillInfoByParceListIds")
void clearWaybillInfoByParceListIds(@RequestBody List<Long> parceListIds);
/**
* 维护指定包件至入库状态
* @param orderPackageId
* @return
*/
@GetMapping(API_PREFIX + "/clearWaybillInfoByParceListIds")
boolean maintainInWarehouse(@RequestParam("orderPackageId") Long orderPackageId);
}

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionLoadscanAbnormalVO.java

@ -202,4 +202,10 @@ public class DistributionLoadscanAbnormalVO extends DistributionLoadscanAbnormal
@ApiModelProperty(value = "完成状态")
private String completeName;
/**
* 货物类型
*/
@ApiModelProperty(value = "货物类型")
private String goodsTypeName;
}

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java

@ -27,6 +27,12 @@ public class WarehouseConfigEntity extends TenantEntity {
@ApiModelProperty(value = "仓库ID")
private Integer isStrictLoading;
/**
* 是否自动释放
*/
@ApiModelProperty(value = "是否自动释放")
private Integer isAutoRelease;
/**
* 预留1
*/

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

@ -560,4 +560,9 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
public void clearWaybillInfoByParceListIds(List<Long> parceListIds) {
distributionParcelListService.clearWaybillInfoByParceListIds(parceListIds);
}
@Override
public boolean maintainInWarehouse(Long orderPackageId) {
return distributionParcelListService.maintainInWarehouse(orderPackageId);
}
}

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

@ -1971,7 +1971,7 @@
</select>
<select id="selectTrayInfoByReservationId" resultType="java.lang.String">
SELECT
GROUP_CONCAT(lwtga.goods_name) AS goodsNames
GROUP_CONCAT(DISTINCT lwtga.tray_code) AS tray_code
FROM
logpm_distribution_signfor AS lds
LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id

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

@ -2223,6 +2223,16 @@
WHEN 1 THEN
'已完成' ELSE '未知'
END AS completeName,
CASE
ldla.goods_type
WHEN 1 THEN
'订制品'
WHEN 2 THEN
'零担'
WHEN 3 THEN
'库存品'
ELSE '未知'
END AS goodsTypeName,
ldla.auditing_time AS auditingTime,
ldla.auditing_user AS auditingUser,
ldla.delivery_type AS deliveryType,

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

@ -276,4 +276,10 @@ public interface IDistributionParcelListService extends BaseService<Distribution
void clearWaybillInfoByParceListIds(List<Long> parceListIds);
/**
* 维护指定包件入库状态
* @param orderPackageId
* @return
*/
boolean maintainInWarehouse(Long orderPackageId);
}

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

@ -8717,6 +8717,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Objects.isNull(distributionDeliverySelfEntity)) {
return Resp.fail("当前操作人不合法");
}
List<String> orderCodes = new ArrayList<>();
switch (type) {
case 1:
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())) {
@ -8777,7 +8778,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
return R.fail(5000, "异常装车");
}
return Resp.scanFail("蹿货", "蹿货");
return Resp.scanFail("窜货", "窜货");
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
//正常进行装车
@ -8791,6 +8792,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
parcelListEntity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
orderCodes.add(parcelListEntity.getOrderCode());
//更新装车时间
distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
@ -9081,7 +9083,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
DistributionReservationEntity trayReservationEntity = distributionReservationService.getById(distrilbutionloadingscanDTO.getReservationId());
List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
for (DistributionParcelListEntity trayParcelListEntity : parcelListEntities) {
log.info("#########!!!!!!!!!!!!!!!!!--------- 88888888888 parcelListEntities={}", parcelListEntities);
if (trayParcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
@ -9119,10 +9120,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscanService.saveBatch(reservationLoadscanEntities);
//这里则进行整托装车的数据构建
//维护订单的信息
if (Func.isNotEmpty(orderCodes)) {
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode, myCurrentWarehouse.getId());
}
if (Func.isNotEmpty(orderPackageCodes)) {
String orderPackages = orderPackageCodes.stream().distinct().collect(Collectors.joining(","));
Map<String, Object> map = new HashMap<>();
@ -9188,6 +9185,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
}
//维护订单数量
if (!orderCodes.isEmpty()) {
String s = orderCodes.stream().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(s,myCurrentWarehouse.getId());
}
warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
trunklinePackageTrackLogClient.addPackageTrackLog(packageLogs);
Integer carLaodNum = getCarLaodNum(distrilbutionloadingscanDTO.getDeliveryId());
@ -9384,7 +9386,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
return Resp.scanSuccess("操作成功", "异常" + abnormalTotal + "件");
return Resp.scanSuccess("操作成功", "装车" + abnormalTotal + "件");
}
@Override
@ -9558,7 +9560,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!mapList.isEmpty()) {
for (Map<String, Object> map : mapList) {
}
reservationAppDetailVO.setTrayList(mapList);
}

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

@ -1428,6 +1428,19 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
baseMapper.clearWaybillInfoByParceListIds(parceListIds);
}
@Override
@Transactional
public boolean maintainInWarehouse(Long orderPackageId) {
DistributionParcelListEntity parcelListEntity = this.getById(orderPackageId);
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
boolean update = this.updateById(parcelListEntity);
//维护订单
distributionStockArticleService.maintenanceOrderMall(parcelListEntity.getStockArticleId()+"");
return update;
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();

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

@ -57,7 +57,9 @@ import com.logpm.oldproject.feign.IWarehouseClient;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.feign.IWarehouseConfigClient;
import com.logpm.warehouse.feign.IWarehouseRetentionScanClient;
import com.logpm.warehouse.feign.IWarehouseUpdownStockUpAreaClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
@ -171,6 +173,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
private IDistributionAsyncService distributionAsyncService;
@Autowired
private IBasicdataWarehouseClient basicdataWarehouseClient;
@Autowired
private IWarehouseConfigClient warehouseConfigClient;
@Autowired
private DistributionReservationMapper distributionReservationMapper;
@Autowired
@ -681,6 +686,20 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error("参数缺失,signforId:{}", distributionSignforDTO.getId());
return null;
}
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
Integer isAutoRelease = warehouseConfig.getIsAutoRelease();
if (Integer.parseInt(IsOrNoConstant.no.getValue()) == isAutoRelease){
//进行异常判断拦截
//查询是否存在异常
List<DistributionLoadscanAbnormalEntity> loadscanAbnormalEntityList = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getReservationId, distributionSignforDTO.getReservationId())
.eq(DistributionLoadscanAbnormalEntity::getWarehouseId, myCurrentWarehouse.getId())
.ne(DistributionLoadscanAbnormalEntity::getComplete, Integer.parseInt(IsOrNoConstant.yes.getValue()))
);
if (!loadscanAbnormalEntityList.isEmpty()) {
return R.fail("当前客户存在异常未完成");
}
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
DistributionSignforEntity distributionSignfor = this.getById(distributionSignforDTO.getId());
Integer loadingNum = distributionSignfor.getLoadedNumber() + distributionSignfor.getLoadedinNumber();
@ -695,8 +714,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error("文员复核查询配送计划失败,deliveryId:{}", distributionSignfor.getDeliveryId());
return R.fail("操作失败,请核对计划信息!!!");
}
// this.updatePicture(distributionSignforDTO);
// this.updateById(distributionSignfor);
//修改预约单的签收状态和装车状态
//查询签收信息
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distributionSignfor.getReservationId());
@ -712,7 +729,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//还需要对未装车未签收的包件进行状态的回退
boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId());
if (!flag) {
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse, AuthUtil.getUser(), deliveryListEntity.getTrainNumber());
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoRelease){
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse, AuthUtil.getUser(), deliveryListEntity.getTrainNumber());
}
}
//查看是否需要进行安装
if (reservationEntity.getIsInstall() == 2) {
@ -832,11 +851,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error(method + "查询签收失败,signingId:{}", signingId);
return null;
}
Integer isHaveAbnormalPackage = signforEntity.getIsHaveAbnormalPackage();
//判断该签收是否存在待审核的异常包件
if (isHaveAbnormalPackage == 2) {
return R.data(200, "存在异常包件", "存在异常包件");
}
// Integer isHaveAbnormalPackage = signforEntity.getIsHaveAbnormalPackage();
// //判断该签收是否存在待审核的异常包件
// if (isHaveAbnormalPackage == 2) {
// return R.data(200, "存在异常包件", "存在异常包件");
// }
//判断该客户是否具备进行复核
//需要满足条件,存在包件或者以备货库存品未装车和签收
@ -845,11 +865,28 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//该客户的包件和库存品都进行装车、签收
return R.data(200, "直接进行复核操作", "直接进行复核操作");
} else {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail(403, "未授权!!!");
}
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
Integer isAutoRelease = warehouseConfig.getIsAutoRelease();
if (Integer.parseInt(IsOrNoConstant.no.getValue()) == isAutoRelease){
//进行异常判断拦截
//查询是否存在异常
List<DistributionLoadscanAbnormalEntity> loadscanAbnormalEntityList = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getReservationId, signforEntity.getReservationId())
.eq(DistributionLoadscanAbnormalEntity::getWarehouseId, myCurrentWarehouse.getId())
.ne(DistributionLoadscanAbnormalEntity::getComplete, Integer.parseInt(IsOrNoConstant.yes.getValue()))
);
if (!loadscanAbnormalEntityList.isEmpty()) {
return R.fail("当前客户存在异常未完成");
}
}
//存在满足进行资源释放的包件,返回前端进行提示确认后
return R.data(200, "此任务存在未完成包件,请确认", "此任务存在未完成包件,请确认");
}
}
@Override
@ -7680,20 +7717,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//判断客户
boolean flag = judgmentClient(reservationEntity, parcelListEntity.getStockArticleId());
if (flag) {
if (OrderPackageReservationStatusConstant.yiyueyue.getValue().equals(parcelListEntity.getOrderPackageReservationStatus())){
return Resp.scanFail("当前包件存在配送计划", "当前包件存在配送计划");
}
return R.fail(3006, null);
} else {
//查询出未审核如果存在多个则不行
DistributionLoadscanAbnormalEntity abnormalEntity = distributionLoadscanAbnormalService.getOne(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getDeliveryListId, deliveryId)
.eq(DistributionLoadscanAbnormalEntity::getReservationId, reservationId)
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode())
.eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, LoadingAbnormalAuditingStatusConstant.daishenhe.getValue())
.eq(DistributionLoadscanAbnormalEntity::getAbnormalType, LoadingAbnormalTypeConstant.jihuayichang.getValue())
);
if (!Objects.isNull(abnormalEntity)){
return Resp.scanFail("此包件存在需回库操作", "此包件存在需回库操作");
return Resp.scanFail("异常装车未处理","异常装车未处理");
}
if (OrderPackageReservationStatusConstant.yiyueyue.getValue().equals(parcelListEntity.getOrderPackageReservationStatus())){
return Resp.scanFail("当前包件存在配送计划", "当前包件存在配送计划");
}
return R.fail(3006, null);
} else {
return Resp.scanFail("不属于当前签收客户", "不属于当前签收客户");
}
}

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

@ -457,7 +457,16 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
switch (warehouseRetentionScanEntity.getConditions()) {
case 1:
//订制品
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions()));
if (RetentionTypeConstant.yichangjuqian.getValue().equals(warehouseRetentionScanEntity.getRetentionType())){
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(
warehouseRetentionScanEntity.getDeliveryId(),
warehouseRetentionScanEntity.getReservationId(),
warehouseRetentionScanEntity.getOrderPackageId(),
warehouseRetentionScanEntity.getConditions())
);
}else {
saveFlah.set(distributionParcelListClient.maintainInWarehouse(warehouseRetentionScanEntity.getOrderPackageId()));
}
break;
case 2:
//回库指定数量的零担包件

Loading…
Cancel
Save