|
|
|
@ -392,6 +392,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
log.info("#############updateBillladingStatus: 更新提货单状态 type={}",type); |
|
|
|
|
|
|
|
|
|
TrunklineBillladingEntity billladingEntity = baseMapper.selectById(billladingId); |
|
|
|
|
TrunklineBillladingEntity updateEntity = new TrunklineBillladingEntity(); |
|
|
|
|
updateEntity.setId(billladingEntity.getId()); |
|
|
|
|
|
|
|
|
|
if (!Objects.isNull(billladingEntity)) { |
|
|
|
|
String billladingCode = billladingEntity.getBillladingCode(); |
|
|
|
|
|
|
|
|
@ -414,6 +417,10 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
if ("1".equals(billladingStatus)) { |
|
|
|
|
billladingEntity.setBillladingStatus("2"); |
|
|
|
|
billladingEntity.setStartTime(CommonUtil.StringToDate(completeTime)); |
|
|
|
|
updateEntity.setBillladingStatus(billladingEntity.getBillladingStatus()); |
|
|
|
|
updateEntity.setStartTime(billladingEntity.getStartTime()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(",未开始变更为提货中"); |
|
|
|
|
} else { |
|
|
|
|
log.warn("##################updateBillladingStatus: 提货单不能更新为提货中 billladingStatus={}", billladingStatus); |
|
|
|
@ -425,6 +432,8 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
if ("2".equals(billladingStatus)) { |
|
|
|
|
billladingEntity.setBillladingStatus("3"); |
|
|
|
|
billladingEntity.setEndTime(CommonUtil.StringToDate(completeTime)); |
|
|
|
|
updateEntity.setBillladingStatus(billladingEntity.getBillladingStatus()); |
|
|
|
|
updateEntity.setEndTime(billladingEntity.getEndTime()); |
|
|
|
|
stringBuffer.append(",提货中变更为提货完成"); |
|
|
|
|
} else { |
|
|
|
|
log.warn("##################updateBillladingStatus: 提货单不能更新为已完成 billladingStatus={}", billladingStatus); |
|
|
|
@ -436,6 +445,8 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
if ("3".equals(billladingStatus)) { |
|
|
|
|
billladingEntity.setBillladingStatus("2"); |
|
|
|
|
billladingEntity.setEndTime(null); |
|
|
|
|
updateEntity.setBillladingStatus(billladingEntity.getBillladingStatus()); |
|
|
|
|
updateEntity.setEndTime(billladingEntity.getEndTime()); |
|
|
|
|
stringBuffer.append(",提货完成变更为提货中"); |
|
|
|
|
} else { |
|
|
|
|
log.warn("##################updateBillladingStatus: 提货单不能更新为提货中 billladingStatus={}", billladingStatus); |
|
|
|
@ -450,6 +461,14 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
billladingEntity.setSettlementTime(date); |
|
|
|
|
billladingEntity.setSettlementId(AuthUtil.getUserId()); |
|
|
|
|
billladingEntity.setSettlementName(AuthUtil.getNickName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateEntity.setBillladingStatus(billladingEntity.getBillladingStatus()); |
|
|
|
|
updateEntity.setSettlementTime(billladingEntity.getSettlementTime()); |
|
|
|
|
updateEntity.setSettlementId(billladingEntity.getSettlementId()); |
|
|
|
|
updateEntity.setSettlementName(billladingEntity.getSettlementName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stringBuffer.append(",提货完成变更为已结算,时间").append(CommonUtil.dateToString(date)).append(",变更人").append(AuthUtil.getNickName()); |
|
|
|
|
|
|
|
|
|
List<TrunklineBillladingWaybillEntity> billladingWaybillEntities = billladingWaybillService.findNoFinishWaybillByBillladingId(billladingId); |
|
|
|
@ -460,6 +479,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
|
|
|
|
|
Set<Long> waybillIdSet = map.keySet(); |
|
|
|
|
List<WarehouseWaybillEntity> waybillEntityList = warehouseWaybillClient.findListByWaybillIds(new ArrayList<>(waybillIdSet)); |
|
|
|
|
|
|
|
|
|
List<WarehouseWaybillEntity> list =new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
waybillEntityList.forEach(waybillEntity -> { |
|
|
|
|
Integer integer = map.get(waybillEntity.getId()); |
|
|
|
|
if(Objects.isNull(integer)){ |
|
|
|
@ -470,8 +492,13 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
billladingNum = 0; |
|
|
|
|
} |
|
|
|
|
waybillEntity.setBillladingNum(Math.max(billladingNum - integer, 0)); |
|
|
|
|
WarehouseWaybillEntity updateWaybill= new WarehouseWaybillEntity(); |
|
|
|
|
updateWaybill.setId(waybillEntity.getId()); |
|
|
|
|
updateWaybill.setBillladingNum(waybillEntity.getBillladingNum()); |
|
|
|
|
|
|
|
|
|
list.add(updateWaybill); |
|
|
|
|
}); |
|
|
|
|
warehouseWaybillClient.updateList(waybillEntityList); |
|
|
|
|
warehouseWaybillClient.updateList(list); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
log.warn("##################updateBillladingStatus: 提货单不能更新为已结算 billladingStatus={}", billladingStatus); |
|
|
|
@ -494,6 +521,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
case 6: |
|
|
|
|
//取消提货
|
|
|
|
|
billladingEntity.setBillladingStatus("5"); |
|
|
|
|
updateEntity.setBillladingStatus(billladingEntity.getBillladingStatus()); |
|
|
|
|
stringBuffer.append(",变更为取消提货,时间").append(CommonUtil.dateToString(new Date())).append(",变更人").append(AuthUtil.getNickName()); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
@ -501,7 +529,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
throw new CustomerException(405, "未知的更新操作"); |
|
|
|
|
} |
|
|
|
|
//更新状态
|
|
|
|
|
updateById(billladingEntity); |
|
|
|
|
updateById(updateEntity); |
|
|
|
|
logEntity.setContent(stringBuffer.toString()); |
|
|
|
|
logEntity.setAfterOpreation(JSON.toJSONString(billladingEntity)); |
|
|
|
|
trunklineBillladingLogService.save(logEntity); |
|
|
|
@ -666,7 +694,13 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
billladingEntity.setRealNum(numVO.getNum()); |
|
|
|
|
billladingEntity.setRealWeight(numVO.getWeight()); |
|
|
|
|
billladingEntity.setRealVolume(numVO.getVolume()); |
|
|
|
|
updateById(billladingEntity); |
|
|
|
|
|
|
|
|
|
TrunklineBillladingEntity t = new TrunklineBillladingEntity(); |
|
|
|
|
t.setId(billladingEntity.getId()); |
|
|
|
|
t.setRealNum(billladingEntity.getRealNum()); |
|
|
|
|
t.setRealWeight(billladingEntity.getRealWeight()); |
|
|
|
|
t.setRealVolume(billladingEntity.getRealVolume()); |
|
|
|
|
updateById(t); |
|
|
|
|
|
|
|
|
|
billladingWaybillService.updateBillladingFeeByBillladingId(billladingEntity); |
|
|
|
|
|
|
|
|
@ -764,7 +798,11 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
|
|
|
|
|
int size = billladingPackageEntities.size(); |
|
|
|
|
noWaybillNoBillladingWaybill.setRealNum(realNum-size); |
|
|
|
|
} |
|
|
|
|
billladingWaybillService.updateById(noWaybillNoBillladingWaybill); |
|
|
|
|
|
|
|
|
|
TrunklineBillladingWaybillEntity t = new TrunklineBillladingWaybillEntity(); |
|
|
|
|
t.setId(noWaybillNoBillladingWaybill.getId()); |
|
|
|
|
t.setRealNum(noWaybillNoBillladingWaybill.getRealNum()); |
|
|
|
|
billladingWaybillService.updateById(t); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|