Browse Source

1.运单日志跟踪逻辑完善

dist.1.3.0
zhenghaoyu 5 months ago
parent
commit
669d7578ca
  1. 27
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillLogDTO.java
  2. 7
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillOrderClient.java
  3. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillTrackClient.java
  4. 26
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  5. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java
  6. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillTrackClient.java
  7. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPacakgeMapper.xml
  8. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPackageMapper.java
  9. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillTrackService.java
  10. 170
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java
  11. 148
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

27
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/WaybillLogDTO.java

@ -0,0 +1,27 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class WaybillLogDTO implements Serializable {
private Long warehouseId;//当前仓库id
private String warehouseName;//当前仓库名称
private String waybillNo;//运单号
private String trainNumber;//车次号
private String carNumber;//车牌号
private String loadingUser;//装车人
private Date deliveryTime;//配送时间
private String signUser;//签收人
private Date signTime;//签收时间
private String driverName;//司机名称
private Integer num;//签收数量
private Integer type;//1三方中转签收 2直发商家签收 3配送签收
private String signOrderCode;//签收单号
private Long userId;
private String nickName;
}

7
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillOrderClient.java

@ -1,7 +1,6 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@ -26,4 +25,10 @@ public interface ITrunklineWaybillOrderClient {
@PostMapping(API_PREFIX+"/findListByWaybillIds")
List<TrunklineWaybillOrderEntity> findListByWaybillIds(@RequestBody List<Long> waybillIds);
@GetMapping(API_PREFIX+"/findEntityByWaybillNoAndOrderCode")
TrunklineWaybillOrderEntity findEntityByWaybillNoAndOrderCode(@RequestParam String waybillNo, @RequestParam String orderCode);
@GetMapping(API_PREFIX+"/updateEntity")
void updateEntity(@RequestBody TrunklineWaybillOrderEntity waybillOrderEntity);
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillTrackClient.java

@ -1,6 +1,7 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.dto.WaybillLogDTO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
@ -17,4 +18,6 @@ public interface ITrunklineWaybillTrackClient {
@PostMapping(API_PREFIX+"/addWaybillLog")
R addWaybillLog(@RequestBody AddWaybillTrackDTO addWaybillTrackDTO);
@PostMapping(API_PREFIX+"/addSignWaybillLog")
void addSignWaybillLog(@RequestBody WaybillLogDTO waybillLogDTO);
}

26
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -15,7 +15,9 @@ import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
@ -51,6 +53,8 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
private final ITrunklineWaybillTrackClient trunklineWaybillTrackClient;
private final ITrunklineWaybillOrderClient waybillOrderClient;
@Override
public R findPageList(AbnormalRecordDTO abnormalRecordDTO) {
IPage<Object> page = new Page<>();
@ -291,6 +295,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
if(!Objects.isNull(waybillEntity)){
waybillId = waybillEntity.getId();
}
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
String warehouseName = warehouseEntity.getName();
@ -306,6 +311,27 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
addWaybillTrackDTO.setWarehouseName(warehouseName);
addWaybillTrackDTO.setNickName(AuthUtil.getNickName());
trunklineWaybillTrackClient.addWaybillLog(addWaybillTrackDTO);
if(warehouseId.equals(destinationWarehouseId)){
TrunklineWaybillOrderEntity waybillOrderEntity = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNo,waybillNo);
if(!Objects.isNull(waybillOrderEntity)){
Integer handleNumber = waybillOrderEntity.getHandleNumber();
Integer totalCount = waybillEntity.getTotalCount();
Integer waybillStatusInt = Integer.parseInt(waybillEntity.getWaybillStatus());
int i = handleNumber + enterNum;
if(waybillStatusInt <= 50){
if(i == totalCount){
waybillEntity.setWaybillStatus("60");
waybillOrderEntity.setHandleNumber(totalCount);
}else{
waybillEntity.setWaybillStatus("50");
waybillOrderEntity.setHandleNumber(i);
}
}
warehouseWaybillClient.updateEntity(waybillEntity);
waybillOrderClient.updateEntity(waybillOrderEntity);
}
}
}
}
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java

@ -44,4 +44,14 @@ public class TrunklineWaybillOrderClient implements ITrunklineWaybillOrderClient
return waybillOrderService.list(lambdaQueryWrapper);
}
@Override
public TrunklineWaybillOrderEntity findEntityByWaybillNoAndOrderCode(String waybillNo, String orderCode) {
return waybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo,orderCode);
}
@Override
public void updateEntity(TrunklineWaybillOrderEntity waybillOrderEntity) {
waybillOrderService.updateById(waybillOrderEntity);
}
}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillTrackClient.java

@ -2,7 +2,9 @@ package com.logpm.trunkline.feign;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
@ -16,6 +18,7 @@ import springfox.documentation.annotations.ApiIgnore;
public class TrunklineWaybillTrackClient implements ITrunklineWaybillTrackClient {
private final IOpenOrderAsyncService openOrderAsyncService;
private final ITrunklineWaybillTrackService trunklineWaybillTrackService;
@Override
public R addWaybillLog(AddWaybillTrackDTO addWaybillTrackDTO) {
@ -23,4 +26,12 @@ public class TrunklineWaybillTrackClient implements ITrunklineWaybillTrackClient
return R.success("调用成功");
}
@Override
public void addSignWaybillLog(WaybillLogDTO waybillLogDTO){
trunklineWaybillTrackService.addSignWaybillLog(waybillLogDTO);
}
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPacakgeMapper.xml

@ -5,5 +5,18 @@
delete from logpm_trunkline_waybill_package where waybill_no = #{waybillNo}
</delete>
<select id="findMaxPackageStatus" resultType="int">
select max(package_status)
from logpm_trunkline_waybill_package
where waybill_no = #{waybillNo}
</select>
<select id="findPackageStatusNum" resultType="int">
select count(*)
from logpm_trunkline_waybill_package
where waybill_no = #{waybillNo}
and package_status = #{packageStatus}
</select>
</mapper>

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillPackageMapper.java

@ -10,4 +10,8 @@ public interface TrunklineWaybillPackageMapper extends BaseMapper<TrunklineWaybi
void deleteByWaybillNo(@Param("waybillNo") String waybillNo);
Integer findMaxPackageStatus(@Param("waybillNo") String waybillNo);
Integer findPackageStatusNum(@Param("waybillNo") String waybillNo,@Param("packageStatus") Integer packageStatus);
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillTrackService.java

@ -2,6 +2,7 @@ package com.logpm.trunkline.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import com.logpm.trunkline.vo.TrunklineWaybillTrackVO;
import org.springblade.core.mp.base.BaseService;
@ -14,4 +15,7 @@ public interface ITrunklineWaybillTrackService extends BaseService<TrunklineWayb
IPage<TrunklineWaybillTrackVO> findUpdateWaybillList(IPage<Object> page, OpenOrderDTO openOrderDTO);
void deleteByWaybillNo(String waybillNo);
void addSignWaybillLog(WaybillLogDTO waybillLogDTO);
}

170
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java

@ -87,76 +87,116 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
@Override
public void updateWaybillStatus(WarehouseWaybillEntity waybillEntity) {
WarehouseWaybillEntity updateWaybillEntity = new WarehouseWaybillEntity();
updateWaybillEntity.setId(waybillEntity.getId());
QueryWrapper<TrunklineWaybillPackageEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no",waybillEntity.getWaybillNo())
.eq("is_deleted",0);
List<TrunklineWaybillPackageEntity> packageEntityList = baseMapper.selectList(queryWrapper);
int size = packageEntityList.size();
Integer noIncomingNum = 0;
Integer incomingNum = 0;
Integer transferNum = 0;
Integer unloadNum = 0;
Integer deliveryNum = 0;
Integer signNum = 0;
for (TrunklineWaybillPackageEntity waybillPackageEntity : packageEntityList) {
Integer packageStatus = waybillPackageEntity.getPackageStatus();
String waybillNo = waybillEntity.getWaybillNo();
Integer totalCount = waybillEntity.getTotalCount();
//查询出当前运单关联包件状态最大的值
Integer packageStatus = baseMapper.findMaxPackageStatus(waybillNo);
//查询该状态包件数量
Integer num = baseMapper.findPackageStatusNum(waybillNo,packageStatus);
WarehouseWaybillEntity updateEntity = new WarehouseWaybillEntity();
updateEntity.setId(waybillEntity.getId());
if(totalCount == num){
if(packageStatus == 0){
noIncomingNum++;
updateEntity.setWaybillStatus("0");
}else if(packageStatus == 10){
incomingNum++;
updateEntity.setWaybillStatus("20");
}else if(packageStatus == 20){
transferNum++;
updateEntity.setWaybillStatus("40");
}else if(packageStatus == 30){
unloadNum++;
updateEntity.setWaybillStatus("60");
}else if(packageStatus == 40){
deliveryNum++;
updateEntity.setWaybillStatus("80");
}else if(packageStatus == 50){
signNum++;
}
}
if(signNum > 0){
if(signNum == size){
updateWaybillEntity.setWaybillStatus("100");
}else{
updateWaybillEntity.setWaybillStatus("90");
updateEntity.setWaybillStatus("100");
}
}else{
if(deliveryNum > 0){
if (deliveryNum == size){
updateWaybillEntity.setWaybillStatus("80");
}else {
updateWaybillEntity.setWaybillStatus("70");
}
}else{
if(unloadNum > 0){
if (unloadNum == size){
updateWaybillEntity.setWaybillStatus("60");
}else {
updateWaybillEntity.setWaybillStatus("50");
}
}else{
if(transferNum > 0){
if (transferNum == size){
updateWaybillEntity.setWaybillStatus("40");
}else {
updateWaybillEntity.setWaybillStatus("30");
}
}else{
if(incomingNum > 0){
if (incomingNum == size){
updateWaybillEntity.setWaybillStatus("20");
}else {
updateWaybillEntity.setWaybillStatus("10");
}
}
}
}
if(packageStatus == 0){
updateEntity.setWaybillStatus("0");
}else if(packageStatus == 10){
updateEntity.setWaybillStatus("10");
}else if(packageStatus == 20){
updateEntity.setWaybillStatus("30");
}else if(packageStatus == 30){
updateEntity.setWaybillStatus("50");
}else if(packageStatus == 40){
updateEntity.setWaybillStatus("70");
}else if(packageStatus == 50){
updateEntity.setWaybillStatus("90");
}
}
warehouseWaybillClient.updateEntity(updateWaybillEntity);
warehouseWaybillClient.updateEntity(updateEntity);
// WarehouseWaybillEntity updateWaybillEntity = new WarehouseWaybillEntity();
// updateWaybillEntity.setId(waybillEntity.getId());
// QueryWrapper<TrunklineWaybillPackageEntity> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("waybill_no",waybillEntity.getWaybillNo())
// .eq("is_deleted",0);
// List<TrunklineWaybillPackageEntity> packageEntityList = baseMapper.selectList(queryWrapper);
// int size = packageEntityList.size();
// Integer noIncomingNum = 0;
// Integer incomingNum = 0;
// Integer transferNum = 0;
// Integer unloadNum = 0;
// Integer deliveryNum = 0;
// Integer signNum = 0;
// for (TrunklineWaybillPackageEntity waybillPackageEntity : packageEntityList) {
// Integer packageStatus = waybillPackageEntity.getPackageStatus();
// if(packageStatus == 0){
// noIncomingNum++;
// }else if(packageStatus == 10){
// incomingNum++;
// }else if(packageStatus == 20){
// transferNum++;
// }else if(packageStatus == 30){
// unloadNum++;
// }else if(packageStatus == 40){
// deliveryNum++;
// }else if(packageStatus == 50){
// signNum++;
// }
// }
//
// if(signNum > 0){
// if(signNum == size){
// updateWaybillEntity.setWaybillStatus("100");
// }else{
// updateWaybillEntity.setWaybillStatus("90");
// }
// }else{
// if(deliveryNum > 0){
// if (deliveryNum == size){
// updateWaybillEntity.setWaybillStatus("80");
// }else {
// updateWaybillEntity.setWaybillStatus("70");
// }
// }else{
// if(unloadNum > 0){
// if (unloadNum == size){
// updateWaybillEntity.setWaybillStatus("60");
// }else {
// updateWaybillEntity.setWaybillStatus("50");
// }
// }else{
// if(transferNum > 0){
// if (transferNum == size){
// updateWaybillEntity.setWaybillStatus("40");
// }else {
// updateWaybillEntity.setWaybillStatus("30");
// }
// }else{
// if(incomingNum > 0){
// if (incomingNum == size){
// updateWaybillEntity.setWaybillStatus("20");
// }else {
// updateWaybillEntity.setWaybillStatus("10");
// }
// }
// }
// }
// }
// }
// warehouseWaybillClient.updateEntity(updateWaybillEntity);
}
@Override
@ -193,7 +233,7 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
packageStatus = 20;
}else if (WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_LOADING.getCode().equals(workNode)){
packageStatus = 10;
}else if (WorkNodeEnums.END_WAREHOUSE_UNLOADING.getCode().equals(workNode)){
}else if (WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode().equals(workNode)){
packageStatus = 30;
} else if (WorkNodeEnums.DISTRIBUTION_LOADING.getCode().equals(workNode)) {
packageStatus = 40;
@ -212,12 +252,16 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
.eq("is_deleted",0);
List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities = baseMapper.selectList(queryWrapper);
if(!trunklineWaybillPackageEntities.isEmpty()){
List<TrunklineWaybillPackageEntity> updateList = new ArrayList<>();
for (TrunklineWaybillPackageEntity trunklineWaybillPackageEntity : trunklineWaybillPackageEntities) {
trunklineWaybillPackageEntity.setPackageStatus(packageStatus);
TrunklineWaybillPackageEntity updateEntity = new TrunklineWaybillPackageEntity();
updateEntity.setId(trunklineWaybillPackageEntity.getId());
updateEntity.setPackageStatus(packageStatus);
updateList.add(updateEntity);
waybillIds.add(trunklineWaybillPackageEntity.getWaybillId());
}
updateBatchById(trunklineWaybillPackageEntities);
updateBatchById(updateList);
for (Long waybillId : waybillIds) {
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);

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

@ -2,21 +2,36 @@ package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import com.logpm.trunkline.mapper.TrunklineWaybillTrackMapper;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import com.logpm.trunkline.vo.TrunklineWaybillTrackVO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineWaybillTrackMapper, TrunklineWaybillTrackEntity> implements ITrunklineWaybillTrackService {
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IOpenOrderAsyncService openOrderAsyncService;
private final ITrunklineWaybillOrderService waybillOrderService;
@Override
public List<TrunklineWaybillTrackEntity> findWaybillLog(Long waybillId, String trackType) {
return baseMapper.findWaybillLog(waybillId,trackType);
@ -31,4 +46,137 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
public void deleteByWaybillNo(String waybillNo) {
baseMapper.deleteByWaybillNo(waybillNo);
}
@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);
}
}
}
private void addZeroWaybillTrackLog(WaybillLogDTO waybillLogDTO, WarehouseWaybillEntity warehouseWaybillEntity) {
Long waybillId = warehouseWaybillEntity.getId();
Integer num = waybillLogDTO.getNum();
String carNumber = waybillLogDTO.getCarNumber();
String driverName = waybillLogDTO.getDriverName();
String trainNumber = waybillLogDTO.getTrainNumber();
String waybillNo = waybillLogDTO.getWaybillNo();
Long warehouseId = waybillLogDTO.getWarehouseId();
String warehouseName = waybillLogDTO.getWarehouseName();
String loadingUser = waybillLogDTO.getLoadingUser();
Date deliveryTime = waybillLogDTO.getDeliveryTime();
String signUser = waybillLogDTO.getSignUser();
Date signTime = waybillLogDTO.getSignTime();
Integer type = waybillLogDTO.getType();
String nickName = waybillLogDTO.getNickName();
Long userId = waybillLogDTO.getUserId();
String signOrderCode = waybillLogDTO.getSignOrderCode();
String typeStr = "";
switch (type){
case 1:
typeStr = "三方中转签收";
break;
case 2:
typeStr = "直发商家签收";
break;
case 3:
typeStr = "配送签收";
break;
default:
typeStr = "未知签收";
}
if(type == 3){
//如果是配送签收需要补录配送装车记录
String operationRemark = warehouseName+" 配送装车"+num+"件,车次号:"+trainNumber+",司机:"+driverName+",车牌号:"+carNumber+",装车人"+ loadingUser+",配送时间"+ CommonUtil.dateToStringGeneral(deliveryTime);
openOrderAsyncService.saveLog(waybillId,waybillNo,"90",warehouseName+" 配送装车",operationRemark,nickName,userId,warehouseId,warehouseName);
}
//存入签收日志
String operationRemark = warehouseName+" "+typeStr+num+"件,车次号:"+trainNumber+",司机:"+driverName+",车牌号:"+carNumber+",签收人"+ signUser+",签收单:"+signOrderCode+",签收时间"+ CommonUtil.dateToStringGeneral(signTime);
openOrderAsyncService.saveLog(waybillId,waybillNo,"100",warehouseName+" "+typeStr,operationRemark,nickName,userId,warehouseId,warehouseName);
warehouseWaybillEntity.setWaybillStatus("100");
//需要更新运单的状态
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(i == totalCount){
warehouseWaybillEntity.setWaybillStatus("100");
waybillOrderEntity.setHandleNumber(i);
}else{
warehouseWaybillEntity.setWaybillStatus("90");
waybillOrderEntity.setHandleNumber(i);
}
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
waybillOrderService.updateById(waybillOrderEntity);
}
}
}
private void addPackageWaybillTrackLog(WaybillLogDTO waybillLogDTO,Long waybillId) {
Integer num = waybillLogDTO.getNum();
String carNumber = waybillLogDTO.getCarNumber();
String driverName = waybillLogDTO.getDriverName();
String trainNumber = waybillLogDTO.getTrainNumber();
String waybillNo = waybillLogDTO.getWaybillNo();
Long warehouseId = waybillLogDTO.getWarehouseId();
String warehouseName = waybillLogDTO.getWarehouseName();
String loadingUser = waybillLogDTO.getLoadingUser();
Date deliveryTime = waybillLogDTO.getDeliveryTime();
String signUser = waybillLogDTO.getSignUser();
Date signTime = waybillLogDTO.getSignTime();
Integer type = waybillLogDTO.getType();
String nickName = waybillLogDTO.getNickName();
Long userId = waybillLogDTO.getUserId();
String signOrderCode = waybillLogDTO.getSignOrderCode();
String typeStr = "";
switch (type){
case 1:
typeStr = "三方中转签收";
break;
case 2:
typeStr = "直发商家签收";
break;
case 3:
typeStr = "配送签收";
break;
default:
typeStr = "未知签收";
}
if(type == 3){
//如果是配送签收需要补录配送装车记录
String operationRemark = warehouseName+" 配送装车"+num+"件,车次号:"+trainNumber+",司机:"+driverName+",车牌号:"+carNumber+",装车人"+ loadingUser+",配送时间"+ CommonUtil.dateToStringGeneral(deliveryTime);
openOrderAsyncService.saveLog(waybillId,waybillNo,"90",warehouseName+" 配送装车",operationRemark,nickName,userId,warehouseId,warehouseName);
}
//存入签收日志
String operationRemark = warehouseName+" "+typeStr+num+"件,车次号:"+trainNumber+",司机:"+driverName+",车牌号:"+carNumber+",签收人"+ signUser+",签收单:"+signOrderCode+",签收时间"+ CommonUtil.dateToStringGeneral(signTime);
openOrderAsyncService.saveLog(waybillId,waybillNo,"100",warehouseName+" "+typeStr,operationRemark,nickName,userId,warehouseId,warehouseName);
}
}

Loading…
Cancel
Save