Browse Source

fix:增加保存日志异常处理

dist.1.2.0^2
pref_mail@163.com 7 months ago
parent
commit
2841dbcb58
  1. 72
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

72
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@ -50,22 +51,30 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
@Override
public void addSignWaybillLog(WaybillLogDTO waybillLogDTO) {
String waybillNo = waybillLogDTO.getWaybillNo();
if(StringUtil.isNotBlank(waybillNo)){
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
Integer waybillType = warehouseWaybillEntity.getWaybillType();
Long waybillId = warehouseWaybillEntity.getId();
if(waybillType == 1){
//订制品运单
//加入零担运单签收日志
addPackageWaybillTrackLog(waybillLogDTO,waybillId);
}else if(waybillType == 2){
//零担运单
addZeroWaybillTrackLog(waybillLogDTO,warehouseWaybillEntity);
try {
String waybillNo = waybillLogDTO.getWaybillNo();
if(StringUtil.isNotBlank(waybillNo)){
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(Objects.isNull(warehouseWaybillEntity)){
log.warn("未找到运单信息 waybillNo:{}",waybillNo);
return;
}
Integer waybillType = warehouseWaybillEntity.getWaybillType();
Long waybillId = warehouseWaybillEntity.getId();
if(waybillType == 1){
//订制品运单
//加入零担运单签收日志
addPackageWaybillTrackLog(waybillLogDTO,waybillId);
}else if(waybillType == 2){
//零担运单
addZeroWaybillTrackLog(waybillLogDTO,warehouseWaybillEntity);
}
}
} catch (Exception e) {
log.error("添加签收日志失败",e);
}
}
@ -116,39 +125,6 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
openOrderAsyncService.saveLog(waybillId,waybillNo,"100",warehouseName+" "+typeStr,operationRemark,nickName,userId,warehouseId,warehouseName);
trunklineWaybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
// if(type != 2){
//
// //需要更新运单的状态
// TrunklineWaybillOrderEntity waybillOrderEntity = waybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo, waybillNo);
// if(!Objects.isNull(waybillOrderEntity)){
// int waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
// Integer totalCount = warehouseWaybillEntity.getTotalCount();
// Integer handleNumber = waybillOrderEntity.getHandleNumber();
// int i = handleNumber + num;
// if(waybillStatusInt < 90){
// if(num == totalCount){
// warehouseWaybillEntity.setWaybillStatus("100");
// waybillOrderEntity.setHandleNumber(num);
// }else{
// warehouseWaybillEntity.setWaybillStatus("90");
// waybillOrderEntity.setHandleNumber(num);
// }
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// waybillOrderService.updateById(waybillOrderEntity);
// }else if(waybillStatusInt == 90){
// if(i == totalCount){
// warehouseWaybillEntity.setWaybillStatus("100");
// waybillOrderEntity.setHandleNumber(i);
// }else{
// waybillOrderEntity.setHandleNumber(i);
// }
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// waybillOrderService.updateById(waybillOrderEntity);
// }
// }
// }else{
// trunklineWaybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
// }
}
private void addPackageWaybillTrackLog(WaybillLogDTO waybillLogDTO,Long waybillId) {

Loading…
Cancel
Save