Browse Source

预约计划、取消计划、市配配车增加日志

master
汤建军 10 months ago
parent
commit
24377765e8
  1. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  4. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  5. 295
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -376,11 +376,11 @@ public class DistributionReservationController extends BladeController {
}
/**
* 预约列表 详情
* 客户列表零担详情
*/
@GetMapping("/getReservationZeroOrderDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distrbutionReservation")
@ApiOperation(value = "客户列表零担详情", notes = "传入distrbutionReservation")
public R<List<DistributionParcelNumberVO>> getReservationZeroOrderDetail(@ApiIgnore @RequestParam Long id,@ApiIgnore @RequestParam Long reservationId) {
List<DistributionParcelNumberVO> parcelNumberVOS = reservationService.getReservationZeroOrderDetail(id,reservationId);
return R.data(parcelNumberVOS);
@ -388,20 +388,19 @@ public class DistributionReservationController extends BladeController {
/**
* 预约列表 详情
* 客户订单列表详情
*/
@GetMapping("/getReservationPackageListByOrderId")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distrbutionReservation")
@ApiOperation(value = "客户订单列表详情", notes = "传入distrbutionReservation")
public R getReservationPackageListByorderId(@ApiIgnore @RequestParam Map<String,Object> packageDTO, Query query) {
R parcelListVOIPage = reservationService.getReservationPackageListByOrderId(packageDTO,Condition.getPage(query));
return R.data(parcelListVOIPage);
}
/**
* 预约列表 详情
* 取消预约包件
*/
@PostMapping("/cancelReservationPackage")
@ApiOperationSupport(order = 1)

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

@ -340,5 +340,5 @@ public interface IDistributionAsyncService {
* 推送预约下包件转配送日志
* @param reservationIds
*/
void recordsReservationDeliveryLog(String reservationIds,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber);
void recordsReservationDeliveryLog(String reservationIds,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber,Integer node,String content);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -2977,7 +2977,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Override
@LogpmAsync("asyncExecutor")
public void recordsReservationDeliveryLog(String reservationIds,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber) {
public void recordsReservationDeliveryLog(String reservationIds,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber,Integer node,String content) {
List<Long> list = Func.toLongList(reservationIds);
if (!list.isEmpty()) {
List<DistributionReservationPackageEntity> distributionReservationPackageEntities = distributionReservationPackageMapper.selectList(Wrappers.<DistributionReservationPackageEntity>query().lambda()
@ -2987,7 +2987,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
List<JSONObject> aaa = new ArrayList<>();
if (!distributionReservationPackageEntities.isEmpty()) {
distributionReservationPackageEntities.forEach(rp->{
String content = "包件在"+warehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"转车次任务,操作方式:批量预约任务转配送,车次号:"+trainNumber;
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
@ -3000,7 +2999,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
trunklinePackageTrackLog.put("orderPackageCode",rp.getPacketBarCode());
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);

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

@ -7344,7 +7344,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;

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

@ -317,6 +317,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
log.error("参数异常:+{" + longs + "}");
R.fail("服务器异常,请重新添加!!");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
return R.fail(403,"未授权!!");
}
//这里就对预约信息列表进行批量的确认状态修改
boolean result = SqlHelper.retBool(distributionReservationMapper.addReservations(longs));
if (result) {
@ -1375,7 +1379,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setDeliveryNumber(packageNum.get());
distributionDeliveryListEntity.setInventoryNub(inventoryNum.get());
distributionDeliveryListService.updateById(distributionDeliveryListEntity);
distributionAsyncService.recordsReservationDeliveryLog(reservationIds,myCurrentWarehouse,user,distributionDeliveryListEntity.getTrainNumber());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"转车次任务,操作方式:批量预约任务转配送,车次号:"+distributionDeliveryListEntity.getTrainNumber();
distributionAsyncService.recordsReservationDeliveryLog(reservationIds,myCurrentWarehouse,user,distributionDeliveryListEntity.getTrainNumber(),WorkNodeEnums.PLAN_DISTRIBUTION.getCode(),content);
return R.status(true);
}
@ -1471,23 +1477,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelListService.updateById(parcelListEntity);
distributionAsyncService.checkStockArticleReservationStatus(p);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"新增计划市配配送,操作方式:新增订单选中包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.PLAN_DELIVERY.getCode());
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("updateUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",myCurrentWarehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",p.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.PLAN_DELIVERY.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
aaa.add(js);
});
} else {
//添加此订单可用所有包件数量
@ -1516,22 +1508,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionAsyncService.checkStockArticleReservationStatus(dp);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"新增计划市配配送,操作方式:新增订单系统默认选中可用包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",myCurrentWarehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",dp.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.PLAN_DELIVERY.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(), content, WorkNodeEnums.PLAN_DELIVERY.getCode());
aaa.add(js);
}
}
});
@ -1653,22 +1631,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"新增计划市配配送,操作方式:订单选中包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",myCurrentWarehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",parcelListEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.CANCEL_DELIVERY.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content,WorkNodeEnums.CANCEL_DELIVERY.getCode());
aaa.add(js);
} else {
//数量维护
packageNum.getAndAdd(distributionParcelListEntity.getQuantity());
@ -1682,27 +1646,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(reservationPackageEntity);
//统计减少包件数量
// reduceNum.getAndAdd(distributionParcelListService.getById(reservationPackageEntity.getParceListId()).getQuantity());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(reservationPackageEntity.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消计划市配配送,操作方式:取消选中包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",reservationEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",reservationEntity.getStatus());
trunklinePackageTrackLog.put("createDept",reservationEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",parcelListEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.CANCEL_DELIVERY.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content,WorkNodeEnums.CANCEL_DELIVERY.getCode());
aaa.add(js);
distributionParcelListService.updateById(parcelListEntity);
if (Func.isNotEmpty(bladeRedis.get("warehouseId:"+myCurrentWarehouse.getId()+"orderCode:"+parcelListEntity.getOrderCode()))){
List<Long> ids = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode());
@ -1716,7 +1665,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationStockarticleEntity.setReservationNum(packageNum.get());
distributionReservationStockarticleService.updateById(reservationStockarticleEntity);
packTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
// distributionAsyncService.changeOrderReservationStatus(distributionStockArticleDTO);
oldStockArticle.remove(k);
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(distributionStockArticleDTO.getOrderCode(),myCurrentWarehouse.getId());
@ -1796,7 +1744,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationStockarticleEntity.setReservationNum(zeroPrderNum.get());
distributionReservationStockarticleService.updateById(reservationStockarticleEntity);
packTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
// oldStockArticle.remove(k);
distributionAsyncService.changeOrderReservationStatus(distributionStockArticleDTO);
oldStockArticle.remove(k);
}
@ -1839,22 +1786,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
p.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageService.updateById(p);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消计划市配配送,操作方式:取消订单,预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",reservationEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",reservationEntity.getStatus());
trunklinePackageTrackLog.put("createDept",reservationEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",p.getPacketBarCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.CANCEL_DELIVERY.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getPacketBarCode(), content,WorkNodeEnums.CANCEL_DELIVERY.getCode());
aaa.add(js);
reduceTotal.getAndAdd(distributionParcelListService.getById(p.getParceListId()).getQuantity());
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
@ -1926,10 +1859,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationStocklistEntity.setSigningStatus(ReservationInventorySigningStatusConstant.weiqianshou.getValue());
reservationStocklistEntity.setRealityNum(0);
distributionReservationStocklistService.save(reservationStocklistEntity);
// DistributionStockListEntity stockListEntity = Func.copy(distributionStockListDTO, DistributionStockListEntity.class);
// Integer quantityOccupied = stockListEntity.getQuantityOccupied();
// stockListEntity.setQuantityOccupied(quantityOccupied + reservationStocklistEntity.getReservationNum());
// distributionStockListService.updateById(stockListEntity);
//维护对应库存品的冻结数量
int a = distributionStockListMapper.updateInventoryQuantityOccupied(distributionStockListDTO.getId(),distributionStockListDTO.getReservationNum());
//对新增的库存品进行明细记录添加
@ -2236,6 +2165,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"计划商配配送,操作方式:订单选择包件,预约任务号:"+reservation.getReservationCode()+",车次号:"+distributionDeliveryListEntity.getTrainNumber();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",p.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
@ -2628,22 +2558,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelListService.updateById(parcelListEntity);
// distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消配送,操作方式:取消配送任务,预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateUser",AuthUtil.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",myCurrentWarehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",rp.getPacketBarCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), rp.getPacketBarCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
aaa.add(js);
} else {
log.error("#################错误包件ID:{}", rp.getParceListId());
}
@ -2664,10 +2580,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionParcelNumberEntity parcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, rzp.getParcelListId()));
if (Func.isNotEmpty(parcelNumberEntity)) {
// parcelNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity() + rzp.getQuantity());
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - rzp.getQuantity());
distributionParcelNumberService.updateById(parcelNumberEntity);
// distributionAsyncService.checkZeroStockArticleReservationStatus(parcelNumberEntity);
}
distributionParcelListService.maintenanceZerpPackageInfo(rzp.getParcelListId());
@ -2738,106 +2652,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
}
return true;
}
// DistributionStockupEntity stockupEntity = distributionReservationMapper.selectStockup(reservationEntity.getId());
// if (Func.isEmpty(stockupEntity) || stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue())){
// if (Func.isNotEmpty(stockupEntity)){
// List<DistributionStockupInfoEntity> stockupInfoEntityList = distributionStockupInfoService.list(Wrappers.<DistributionStockupInfoEntity>query().lambda()
// .eq(DistributionStockupInfoEntity::getStockupId, stockupEntity.getId()));
// boolean flag = stockupInfoEntityList.stream().allMatch(info -> Func.equals(info.getReservationId(), reservationEntity.getId()));
// if (flag){
// //删除中间表和备货表
// DistributionStockupInfoEntity stockupInfoEntity = stockupInfoEntityList.get(0);
// distributionStockupInfoMapper.deleteByReservationId(stockupInfoEntity.getReservationId());
// distributionStockupMapper.deleteStockUpById(stockupInfoEntity.getStockupId());
// }else {
// //只删除中间表
// distributionStockupInfoMapper.deleteByReservationId(reservationEntity.getId());
// }
// }
// //这里取消还需要对订单、包件、库存品的数据进行维护
//// -------------------------------------------维护订单——————————————————————————————————————————————————————————————————————————
// List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(reservationEntity.getId());
// if (Func.isNotEmpty(reservationStockarticleEntityList)&&reservationStockarticleEntityList.size()>0){
// List<DistributionStockArticleEntity> stockArticleList = distributionReservationMapper.getStockArticleList(reservationEntity.getId());
// stockArticleList.forEach(s->{
// if (s.getIsZero().equals(IsOrNoConstant.no.getValue())){
// s.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
// distributionStockArticleService.updateById(s);
// }else {
// List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
// .eq(DistributionReservationZeroPackageEntity::getReservationId, reservationEntity.getId())
// .eq(DistributionReservationZeroPackageEntity::getStockArticleId, s.getId())
// .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationOrderStatusConstant.quxiao.getValue()));
// }
//
// });
// reservationStockarticleEntityList.forEach(rs->{
// rs.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
// distributionReservationStockarticleService.updateById(rs);
// });
// }
//// ----------------------------------------维护包件————————————————————————————————————————————————————————————————————————————————————
// List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationMapper.selectReservationPackageByReservationId(reservationEntity.getId());
// if (Func.isNotEmpty(reservationPackageEntityList) && reservationPackageEntityList.size() > 0){
// List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId());
// parcelListEntities.forEach(p->{
// p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
// distributionParcelListService.updateById(p);
// });
// reservationPackageEntityList.forEach(rp->{
// rp.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
// distributionReservationPackageService.updateById(rp);
// });
//
// }
//
//// ——————————————————————————————————————————————————维护库存品———————————————————————————————————————————————————————————————————————————
//
//
// }else {
// //仅仅标注该客户的预约计划取消
//// -------------------------------------------维护订单——————————————————————————————————————————————————————————————————————————
// List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(reservationEntity.getId());
// if (Func.isNotEmpty(reservationStockarticleEntityList)&&reservationStockarticleEntityList.size()>0){
// reservationStockarticleEntityList.forEach(rs->{
// rs.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
// distributionReservationStockarticleService.updateById(rs);
// });
// }
//// ----------------------------------------维护包件————————————————————————————————————————————————————————————————————————————————————
// List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationMapper.selectReservationPackageByReservationId(reservationEntity.getId());
// if (Func.isNotEmpty(reservationPackageEntityList) && reservationPackageEntityList.size() > 0){
// reservationPackageEntityList.forEach(rp->{
// rp.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
// distributionReservationPackageService.updateById(rp);
// });
// }
//
//// ——————————————————————————————————————————————————维护库存品———————————————————————————————————————————————————————————————————————————
// List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationEntity.getId());
// if (Func.isNotEmpty(distributionReservationStocklistEntities) && distributionReservationStocklistEntities.size() > 0){
// //进行库存品库存数量的维护
// distributionReservationStocklistEntities.forEach(i->{
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getStocklistId());
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - i.getReservationNum());
// distributionStockListService.updateById(stockListEntity);
// i.setStockListStatus(ReservationInventoryStatusConstant.quxiao.getValue());
// distributionReservationStocklistService.updateById(i);
// });
// }
// }
//
// reservationEntity.setCancelReason(reservationDTO.getCancelReason());
// reservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue());
// this.updateById(reservationEntity);
// return true;
// }
@Override
public R<?> getReservationPackage(String reservationId, String id) {
@ -3179,22 +2997,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// distributionAsyncService.checkStockArticleReservationStatus(dp);
orderPackageCodes.add(dp.getOrderPackageCode());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"计划配送,操作方式:系统默认全部包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",reservationEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",reservationEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",reservationEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",reservationEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",reservationEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",reservationEntity.getStatus());
trunklinePackageTrackLog.put("createDept",reservationEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",dp.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode", WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(), content, WorkNodeEnums.PLAN_DELIVERY.getCode());
aaa.add(js);
}
}
@ -3217,22 +3021,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelListService.updateById(p);
orderPackageCodes.add(p.getOrderPackageCode());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"计划市配配送,操作方式:选择包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId());
trunklinePackageTrackLog.put("createTime",reservationEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",reservationEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",reservationEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",reservationEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",reservationEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",reservationEntity.getStatus());
trunklinePackageTrackLog.put("createDept",reservationEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",p.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",reservationEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseName",reservationEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode", WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(), content, WorkNodeEnums.PLAN_DELIVERY.getCode());
aaa.add(js);
}
}
});
@ -3332,15 +3122,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
}
// distributionReservationStockarticleEntity.setIsZero(IsOrNoConstant.yes.getValue());
// distributionReservationStockarticleEntity.setReservationId(reservationId);
// distributionReservationStockarticleEntity.setStockArticleId(s.getId());
// distributionReservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.zhengchang.getValue());
// distributionReservationStockarticleEntity.setStockArticleCode(s.getOrderCode());
// distributionReservationStockarticleEntity.setIsHaveData(s.getIsHaveData());
distributionReservationStockarticleEntity.setReservationNum(zeroPackageNum.get());
// distributionReservationStockarticleService.save(distributionReservationStockarticleEntity);
// packageTotal.getAndAdd(distributionReservationStockarticleEntity.getReservationNum());
}
Long stockArticleId = s.getId();
distributionReservationStockarticleEntity.setReservationId(reservationId);
@ -3352,10 +3134,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationStockarticleService.save(distributionReservationStockarticleEntity);
packageTotal.getAndAdd(distributionReservationStockarticleEntity.getReservationNum());
// distributionAsyncService.changeOrderReservationStatus(stockArticleDTO);
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(),s.getWarehouseId());
// WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo();
// String consigneeMobile = byWaybillNo.getConsigneeMobile();
if (!packageLockIds.isEmpty()){
//判断此类包件是否还存在于缓存中
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() +"orderCode:"+ s.getOrderCode());
@ -3382,8 +3161,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
inventoryList.forEach(i -> {
//如果库存品存在占用数量,这里就直接进行累加
//对库存品的数量进行维护,将预约单的库存品数量进行冻结
// int count = i.getOutboundQuantity() + i.getReservationNum();
// i.setQuantityOccupied(count);
DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getId());
int keyongshuliang = stockListEntity.getQuantityStock() - stockListEntity.getQuantityOccupied();
if (i.getReservationNum() > keyongshuliang) {
@ -3449,7 +3226,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
});
}
//这里对订单自编号进行处理
// str = str.replaceFirst(",","");
//拼接在库和库存订单编号
if (Func.isNotEmpty(orderNumber)) {
String str = String.join(",", orderNumber);
@ -3485,12 +3261,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
String s = String.join(",", serviceNumber);
reservationEntity.setServiceNumber(s);
}
// reservationEntity.setReservationStatus(distributionReservationDTO.getReservationStatus());
reservationEntity.setOrderSource(ReservationOrderSourceConstant.zijian.getValue());
if (Func.isNotEmpty(distributionReservationDTO.getServeType())) {
reservationEntity.setServeType(distributionReservationDTO.getServeType());
}
// reservationEntity.setReservationNum(stockArticleCount.get());
reservationEntity.setReservationStockListNum(stockListCount.get());
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue());
@ -3897,4 +3671,25 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
public List<DistributionReservationEntity> selectListByDeliveryId(Long id) {
return baseMapper.selectListByDeliveryId(id);
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse,BladeUser user,String orderPackageCode,String content,Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",warehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;
}
}

Loading…
Cancel
Save