Browse Source

1.怎加取消的作业节点

pre-production
pref_mail@163.com 4 months ago
parent
commit
9dd6a70bd6
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/enums/BizOperationEnums.java
  2. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  3. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

1
blade-biz-common/src/main/java/org/springblade/common/enums/BizOperationEnums.java

@ -13,6 +13,7 @@ public enum BizOperationEnums implements IDict<Integer> {
ADD(1, "新增"),
MODIFY(2, "修改"),
DELETE(3, "删除"),
REMOVE(4, "移除"),
;
BizOperationEnums(Integer code, String value) {

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

@ -46,14 +46,7 @@ import com.logpm.distribution.mapper.DistributionStockMapper;
import com.logpm.distribution.mapper.DistributionStockupInfoMapper;
import com.logpm.distribution.mapper.DistributionStockupMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionReservationOrderPackageVO;
import com.logpm.distribution.vo.DistributionReservationVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.vo.DistributionStockupOrderListVO;
import com.logpm.distribution.vo.DistributionStockupStockListVO;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionReservationWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
@ -3966,6 +3959,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
List<Long> list = Func.toLongList(distributionCancelReservationPackageDTO.getPackageIds());
log.info(method + "取消包件>>>>:{}", distributionCancelReservationPackageDTO.getPackageIds());
Map<String,List> map = new HashMap<>();
List<DistributionReservationPackageEntity> allPackageEntityList = new ArrayList<>();
List<DistributionReservationZeroPackageEntity> allZeroPackageEntityList = new ArrayList<>();
List<DistributionReservationStocklistEntity> allStockListEntityList = new ArrayList<>();
switch (distributionCancelReservationPackageDTO.getType()) {
case 1:
@ -3996,6 +3995,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListMapper.updateById(parcelListEntity);
// 增加移除的包件
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
reservationPackageEntity.setPacketBarCode(parcelListEntity.getOrderPackageCode());
reservationPackageEntity.setParceListId(parcelListEntity.getId());
allPackageEntityList.add(reservationPackageEntity);
/**
* 取消指定预约下包件
*/
@ -4038,11 +4042,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
int QuantityOccupied = stockListEntity.getQuantityOccupied() - disStockListDetailEntity.getNum();
stockListEntity.setQuantityOccupied(QuantityOccupied);
distributionStockListService.updateById(stockListEntity);
DistributionReservationStocklistEntity reservationStocklistEntity =new DistributionReservationStocklistEntity();
reservationStocklistEntity.setStocklistId(disStockListDetailEntity.getStockListId());
reservationStocklistEntity.setReservationId(reservationEntity.getId());
allStockListEntityList.add(reservationStocklistEntity);
}
//维护对应库存品信息
distributionReservationStocklistService.maintenanceReservationStockList(distributionCancelReservationPackageDTO.getReservationId());
break;
}
if (!allPackageEntityList.isEmpty()) {
map.put("1",allPackageEntityList);
}
if (!allStockListEntityList.isEmpty()) {
map.put("3",allStockListEntityList);
}
//维护预约单状态
this.maintenanceReservationInfo(distributionCancelReservationPackageDTO.getReservationId());
//维护预约单数量
@ -4051,13 +4068,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListService.maintenanceDeliveryInfo(distributionCancelReservationPackageDTO.getDeliveryId());
//维护配送任务数量
distributionDeliveryListService.maintenanceDeliveryNum(distributionCancelReservationPackageDTO.getDeliveryId());
// 作业节点推送
DistributionDeliveryListEntity deliveryListEntity= distributionDeliveryListService.getById(distributionCancelReservationPackageDTO.getDeliveryId());
NodeFanoutMsg<DistributionTaskVO> nodeFanoutMsg = distributionDeliveryListService.buildNodeFanoutMsgForPlan(deliveryListEntity, AuthUtil.getUser(), BizOperationEnums.MODIFY);
distributionNodeWorkService.planDelivery(nodeFanoutMsg, AuthUtil.getUser());
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = buildNodeFanoutMsgByReservation(reservationEntity,map,BizOperationEnums.REMOVE);
distributionNodeWorkService.planReservation(nodeFanoutMsg,AuthUtil.getUser());
return R.status(true);
}

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

@ -193,10 +193,7 @@ import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.ConsigneeArriveVO;
import org.springblade.common.model.GAddressVo;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.*;
import org.springblade.common.node.BillLadingNode;
import org.springblade.common.node.DeliveryNode;
import org.springblade.common.node.ReservationNode;
@ -383,7 +380,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
private ITrunklineWaybillTrackClient trunklineWaybillTrackClient;
@Autowired
private IDistributionNodeWorkService iDistributionNodeWorkService;
private IDistributionNodeWorkService distributionNodeWorkService;
@Autowired
private ILogClient logClient;
@ -404,6 +401,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IDistributionPlanLogService distributionPlanLogService;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -840,7 +838,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 推送作业节点数据
NodeFanoutMsg<org.springblade.common.model.DistributionReCheckSignVO> nodeFanoutMsg = buildNodeFanoutMsgByReCheck(deliveryListEntity,reservationEntity);
iDistributionNodeWorkService.signForCheck(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signForCheck(nodeFanoutMsg, AuthUtil.getUser());
// // 复核作业节点推送
// iDistributionNodeWorkService.signForCheck(DistributionSignforEntity distributionSignforEntity,DistributionReservationEntity reservationEntity);
@ -1167,7 +1165,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
// 增加PC库存品签收
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.CLERK);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
//维护签收数量
@ -1546,7 +1544,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 发送作业节点
// 作业节点推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList,OperatModeConstant.BATCH);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
//查询计划和是否进行装车
@ -1845,6 +1843,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error(method + "DeliveryId参数缺失");
return R.fail("请联系管理员维护!!!");
}
Map<String,List> map = new HashMap<>();
List<Long> list = Func.toLongList(distrilbutionloadingscanDTO.getZeroPackageIds());
//查询是否进行装车或者签收
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
@ -1868,6 +1868,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Map<Long, List<DistributionReservationZeroPackageEntity>> planMap;
if (Func.isNotEmpty(planZeroPackageEntities)) {
planMap = planZeroPackageEntities.stream().collect(Collectors.groupingBy(DistributionReservationZeroPackageEntity::getStockArticleId));
map.put("2", planZeroPackageEntities);
} else {
planMap = null;
}
@ -1921,6 +1923,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
deliveryListEntity.setOrderNumber(newOrderDeliveryNumber);
deliveryListEntity.setCustomersNumber(newCustomersNumber);
distributionDeliveryListService.updateById(deliveryListEntity);
// 发送零担作业节点
// 作业节点推送
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity,map,BizOperationEnums.REMOVE);
distributionNodeWorkService.planReservation(nodeFanoutMsg,AuthUtil.getUser());
} else {
log.error(method + "查询原计划零担信息错误reservationId:{},ids:{}", distrilbutionloadingscanDTO.getReservationId(), list);
return R.fail("计划查询错误");
@ -3165,7 +3175,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes);
@ -3329,7 +3339,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// sendMessage(distrilbutionloadingscanDTO.getBarcode(), distributionReservationEntity.getReservationCode(),
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
iDistributionNodeWorkService.signFor(parcelListEntity, distributionReservationEntity.getId(), singleTime, myCurrentWarehouse.getName());
distributionNodeWorkService.signFor(parcelListEntity, distributionReservationEntity.getId(), singleTime, myCurrentWarehouse.getName());
} catch (Exception e) {
// throw new RuntimeException(e);
log.error(">>>> 签收作业节点广播报错", e);
@ -3637,7 +3647,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushDatas, OperatModeConstant.CLERK);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return R.data(orderpackages, "签收成功");
} catch (Exception e) {
@ -4078,7 +4088,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccess("操作成功", s);
} else {
@ -4471,7 +4481,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccess("签收成功", str);
@ -5000,7 +5010,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//进行打卡信息保存
distributionPositioningService.save(distributionPositioning);
NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg = buildConsigneeArriveVO(deliveryListEntity, reservationEntity, add, user);
iDistributionNodeWorkService.carArrived(nodeFanoutMsg, user);
distributionNodeWorkService.carArrived(nodeFanoutMsg, user);
return Resp.scanSuccess("打卡成功", "打卡成功");
} else {
return Resp.scanSuccess("打卡失败", "打卡失败,请重试");
@ -5528,7 +5538,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 推送作业节点
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildNodeFanoutMsgByOneClick(distributionDeliveryListEntity, reservationEntity, distributionLoadscaninvnEntityLists, distributionLoadscanEntityLists);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return R.data(map);
}
@ -6104,7 +6114,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":reservationId:", distributionSignfor.getReservationId(), 60L);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildNodeFanoutMsgByOneClick(distributionDeliveryListEntity, reservationEntity, distributionLoadscaninvnEntityLists, distributionLoadscanEntityLists);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
Integer num = baseMapper.signforNum(distributionSignforEntity.getReservationId());
return Resp.scanSuccess(num + "件", num + "件");
}
@ -7153,7 +7163,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccess("签收成功", str);
@ -8514,12 +8524,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!pushInventoryList.isEmpty()) {
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushInventoryList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
if (!pushList.isEmpty()) {
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
if (!orderCodes.isEmpty()) {
String collect = orderCodes.stream().distinct().collect(Collectors.joining(","));

Loading…
Cancel
Save