|
|
@ -75,15 +75,8 @@ import com.logpm.factorydata.util.FactoryDataMessageSender; |
|
|
|
import com.logpm.factorydata.vo.NodePushMsg; |
|
|
|
import com.logpm.factorydata.vo.NodePushMsg; |
|
|
|
import com.logpm.factorydata.vo.PushData; |
|
|
|
import com.logpm.factorydata.vo.PushData; |
|
|
|
import com.logpm.trunkline.dto.AddWaybillTrackDTO; |
|
|
|
import com.logpm.trunkline.dto.AddWaybillTrackDTO; |
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; |
|
|
|
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; |
|
|
|
|
|
|
|
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity; |
|
|
|
|
|
|
|
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity; |
|
|
|
|
|
|
|
import com.logpm.trunkline.feign.*; |
|
|
|
import com.logpm.trunkline.feign.*; |
|
|
|
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; |
|
|
|
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWayBillDetail; |
|
|
|
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
import com.logpm.warehouse.feign.IWarehousePackageTrackLogClient; |
|
|
|
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; |
|
|
|
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; |
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; |
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; |
|
|
@ -120,7 +113,6 @@ import org.springblade.common.constant.signing.SignforStatusConstant; |
|
|
|
import org.springblade.common.constant.stockup.StockupStatusConstant; |
|
|
|
import org.springblade.common.constant.stockup.StockupStatusConstant; |
|
|
|
import org.springblade.common.constant.stockup.StockupTypeConstant; |
|
|
|
import org.springblade.common.constant.stockup.StockupTypeConstant; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.redis.cache.BladeRedis; |
|
|
|
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
@ -129,20 +121,17 @@ import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.system.entity.Tenant; |
|
|
|
import org.springblade.system.entity.Tenant; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
@ -1739,7 +1728,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
@LogpmAsync("asyncExecutor") |
|
|
|
@LogpmAsync("asyncExecutor") |
|
|
|
public void releaseSource(Long reservationId, Long warehouseId) { |
|
|
|
public void releaseSource(Long reservationId, BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber) { |
|
|
|
String method = "##########################DistributionAsyncServiceImpl.releaseSource"; |
|
|
|
String method = "##########################DistributionAsyncServiceImpl.releaseSource"; |
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId); |
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId); |
|
|
|
StringBuilder builder = new StringBuilder(); |
|
|
|
StringBuilder builder = new StringBuilder(); |
|
|
@ -1747,10 +1736,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { |
|
|
|
//存在订单
|
|
|
|
//存在订单
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId); |
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId); |
|
|
|
if (Func.isNotEmpty(distributionParcelListEntities)) { |
|
|
|
if (Func.isNotEmpty(distributionParcelListEntities)) { |
|
|
|
|
|
|
|
|
|
|
|
List<Long> packageIds = distributionParcelListEntities.stream() |
|
|
|
List<Long> packageIds = distributionParcelListEntities.stream() |
|
|
|
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) |
|
|
|
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) |
|
|
|
.map(DistributionParcelListEntity::getId) |
|
|
|
.map(DistributionParcelListEntity::getId) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(packageIds)) { |
|
|
|
if (Func.isNotEmpty(packageIds)) { |
|
|
|
//对包件进行批量的修改
|
|
|
|
//对包件进行批量的修改
|
|
|
|
//将这些包件恢复到初始状态
|
|
|
|
//将这些包件恢复到初始状态
|
|
|
@ -1758,7 +1749,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { |
|
|
|
} |
|
|
|
} |
|
|
|
//维护这些进行包件对应的订单
|
|
|
|
//维护这些进行包件对应的订单
|
|
|
|
String orderCodes = distributionParcelListEntities.stream() |
|
|
|
String orderCodes = distributionParcelListEntities.stream() |
|
|
|
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) |
|
|
|
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) |
|
|
|
|
|
|
|
&& !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) |
|
|
|
.map(DistributionParcelListEntity::getOrderCode) |
|
|
|
.map(DistributionParcelListEntity::getOrderCode) |
|
|
|
.distinct().collect(Collectors.joining(",")); |
|
|
|
.distinct().collect(Collectors.joining(",")); |
|
|
|
log.info(method + "维护订制品订单:{}", orderCodes); |
|
|
|
log.info(method + "维护订制品订单:{}", orderCodes); |
|
|
@ -1768,9 +1760,25 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { |
|
|
|
if(!packageIds.isEmpty() && reservationId!=null){ |
|
|
|
if(!packageIds.isEmpty() && reservationId!=null){ |
|
|
|
//完成对该客户下此包件任务的取消
|
|
|
|
//完成对该客户下此包件任务的取消
|
|
|
|
int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId, packageIds); |
|
|
|
int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId, packageIds); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<JSONObject> aaa = new ArrayList<>(); |
|
|
|
|
|
|
|
distributionParcelListEntities.forEach(k->{ |
|
|
|
|
|
|
|
if (k.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()) |
|
|
|
|
|
|
|
&& k.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){ |
|
|
|
|
|
|
|
String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"完成复核,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode(); |
|
|
|
|
|
|
|
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CLERK_REVIEW.getCode()); |
|
|
|
|
|
|
|
aaa.add(js); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"复核取消计划无操作包件,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode(); |
|
|
|
|
|
|
|
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode()); |
|
|
|
|
|
|
|
aaa.add(js); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (!aaa.isEmpty()) { |
|
|
|
|
|
|
|
trunklinePackageTrackLogClient.addPackageTrackLog(aaa); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//维护预约订单状态
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(reservationId); |
|
|
|
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(reservationId); |
|
|
|
if (Func.isNotEmpty(distributionParcelNumberDTOS)) { |
|
|
|
if (Func.isNotEmpty(distributionParcelNumberDTOS)) { |
|
|
@ -1799,8 +1807,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { |
|
|
|
reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds); |
|
|
|
reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouseId); |
|
|
|
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouse.getId()); |
|
|
|
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouseId); |
|
|
|
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouse.getId()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//存在库存品信息
|
|
|
|
//存在库存品信息
|
|
|
@ -3011,4 +3019,23 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|