Browse Source

复核签收日志增加

master
汤建军 8 months ago
parent
commit
4e7a5e5143
  1. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  3. 59
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  4. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -163,7 +163,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
if (!stringList.isEmpty()) { if (!stringList.isEmpty()) {
basicdataStoreBusinessService.deleteLogic(stringList); basicdataStoreBusinessService.deleteLogic(stringList);
} }
} }
for (String s : basicdataClient.getTypeServiceList()) { for (String s : basicdataClient.getTypeServiceList()) {
//添加服务类型 //添加服务类型

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

@ -316,7 +316,7 @@ public interface IDistributionAsyncService {
* 释放当前客户能够进行资源释放的包件包含库存品 * 释放当前客户能够进行资源释放的包件包含库存品
* @param reservationId * @param reservationId
*/ */
void releaseSource(Long reservationId,Long warehouseId); void releaseSource(Long reservationId,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber);
/** /**
* 进行干线日志保存 * 进行干线日志保存

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

@ -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;
}
} }

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

@ -630,6 +630,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.info("复核签收装车数和签收数不一致,装车数:{},签收数:{}", loadingNum,signNum); log.info("复核签收装车数和签收数不一致,装车数:{},签收数:{}", loadingNum,signNum);
return R.fail("存在装车还未签收数据!!!"); return R.fail("存在装车还未签收数据!!!");
} }
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distributionSignfor.getTrainNumber());
if (Func.isEmpty(deliveryListEntity)) {
log.error("文员复核查询配送计划失败,deliveryId:{}", distributionSignfor.getTrainNumber());
return R.fail("操作失败,请核对计划信息!!!");
}
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
distributionSignfor.setExamineUserId(user.getUserId()); distributionSignfor.setExamineUserId(user.getUserId());
distributionSignfor.setSigningStatus(SignforStatusConstant.yiqianshou.getValue()); distributionSignfor.setSigningStatus(SignforStatusConstant.yiqianshou.getValue());
@ -649,7 +654,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//还需要对未装车未签收的包件进行状态的回退 //还需要对未装车未签收的包件进行状态的回退
boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId()); boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId());
if (!flag) { if (!flag) {
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse.getId()); distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse,AuthUtil.getUser(),deliveryListEntity.getTrainNumber());
} }
return R.success("操作成功"); return R.success("操作成功");
} }

Loading…
Cancel
Save