Browse Source

Merge branch 'dev' into pre-production

master
zhenghaoyu 1 year ago
parent
commit
c5eefc425f
  1. 38
      blade-biz-common/src/main/java/org/springblade/common/constant/IncomingTypeEnum.java
  2. 8
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  3. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillTrackClient.java
  4. 60
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehousePackageTrackLogEntity.java
  5. 29
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehousePackageTrackLogClient.java
  6. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java
  7. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java
  8. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  9. 43
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  10. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IPackageTrackLogAsyncService.java
  11. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  12. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  13. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  14. 47
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/PackageTrackLogAsyncServiceImpl.java
  15. 25
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  16. 288
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  17. 22
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java
  18. 73
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehousePackageTrackLogController.java
  19. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehousePackageTrackLogDTO.java
  20. 39
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehousePackageTrackLogClient.java
  21. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehousePackageTrackLogMapper.java
  22. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehousePackageTrackLogService.java
  23. 26
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehousePackageTrackLogServiceImpl.java

38
blade-biz-common/src/main/java/org/springblade/common/constant/IncomingTypeEnum.java

@ -0,0 +1,38 @@
package org.springblade.common.constant;
import lombok.Getter;
@Getter
public enum IncomingTypeEnum {
MB_INCOMING(1, "码板打托"),
SCAN_INCOMING(2, "扫码入库"),
LINE_INCOMING(3, "直接入库"),
CARS_NO_INCOMING(4, "按车次号入库"),
ORDER_CODE_INCOMING(5, "按订单号入库"),
PACKAGE_INCOMING(6, "按件入库"),
BATCH_INCOMING(7, "批量卸车入库"),
UNLOAD_TRAY_INCOMING(8, "托盘卸车入库"),
UNLOAD_TRAY_ONE(9, "卸分一体");
private Integer code;
private String value;
IncomingTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static String getValue(Integer code) {
for (IncomingTypeEnum value : IncomingTypeEnum.values()) {
if (value.getCode().equals(code)) {
return value.getValue();
}
}
return null;
}
}

8
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -16,14 +16,14 @@ public enum WorkNodeEnums implements Serializable {
INITIAL_DATA_ENTRY(10, "数据入库"),
INITIAL_WAREHOUSE_ENTRY(20, "始发仓入库"),
BILLING(30, "开单"),
INITIAL_WAREHOUSE_LOADING(40, "始发仓装车"),
CANCEL_INITIAL_WAREHOUSE_LOADING(50, "始发仓取消装车"),
INITIAL_WAREHOUSE_LOADING(40, "装车"),
CANCEL_INITIAL_WAREHOUSE_LOADING(50, "取消装车"),
INITIAL_WAREHOUSE_DEPART(60, "始发仓发车"),
CANCEL_INITIAL_WAREHOUSE_DEPART(70, "始发仓取消发车"),
NET_ARRIVE_CAR(80,"网点到车"),
CANCEL_NET_ARRIVE_CAR(90,"网点取消到车"),
UNLOAD_INCOMING_WAREHOUSE(100,"卸车入库"),
TRANSFER_WAREHOUSE_UNLOADING(110, "网点卸车确认"),
TRANSFER_WAREHOUSE_UNLOADING(110, "卸车确认"),
TRANSFER_WAREHOUSE_DEPART(120, "网点发车"),
CANEL_TRANSFER_WAREHOUSE_DEPART(130, "网点取消发车"),
FINAL_NET_ARRIVE_CAR(140,"终点到车"),
@ -33,7 +33,7 @@ public enum WorkNodeEnums implements Serializable {
TRIPARTITE_TRANSFER_DEPART(180, "三方中转发车"),
CANCEL_TRIPARTITE_TRANSFER_DEPART(190, "三方中转取消发车"),
ARRICE_TRIPARTITE_TRANSFER_DEPART(200, "三方中转到达"),
sign_TRIPARTITE_TRANSFER_DEPART(210, "三方中转签收"),
SIGN_TRIPARTITE_TRANSFER_DEPART(210, "三方中转签收"),
SORTING_TRAYS(220, "分拣打托"),
UN_SORTING_TRAYS(230, "包件解托"),
PUTAWAY(240, "上架"),

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

@ -4,7 +4,7 @@ import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(
@ -14,7 +14,7 @@ public interface ITrunklineWaybillTrackClient {
String API_PREFIX = "trunklineWaybillOrder/client";
@GetMapping(API_PREFIX+"/addWaybillLog")
@PostMapping(API_PREFIX+"/addWaybillLog")
R addWaybillLog(@RequestBody AddWaybillTrackDTO addWaybillTrackDTO);
}

60
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehousePackageTrackLogEntity.java

@ -0,0 +1,60 @@
package com.logpm.warehouse.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_warehouse_package_track_log")
@ApiModel(value = "WarehousePackageTrackLog对象", description = "包件日志跟踪记录表")
@EqualsAndHashCode(callSuper = true)
public class WarehousePackageTrackLogEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
@ApiModelProperty(value = "包件码")
private String orderPackageCode;
@ApiModelProperty(value = "仓库id")
private Long warehouseId;
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
@ApiModelProperty(value = "工作节点")
private Integer workNode;
@ApiModelProperty(value = "描述")
private String content;
@ApiModelProperty(value = "操作人")
private String operator;
}

29
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehousePackageTrackLogClient.java

@ -0,0 +1,29 @@
package com.logpm.warehouse.feign;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_WAREHOUSE_NAME
)
public interface IWarehousePackageTrackLogClient {
String API_PREFIX = "warehousePackageTrackLog/client";
String TOP = API_PREFIX + "/top";
@PostMapping(API_PREFIX+"/addLog")
void addLog(@RequestBody WarehousePackageTrackLogEntity packageTrackLogEntity);
@PostMapping(API_PREFIX+"/addLogList")
void addLogList(@RequestBody List<WarehousePackageTrackLogEntity> packageTrackLogEntityList);
@PostMapping(API_PREFIX+"/findPackageTrackList")
List<WarehousePackageTrackLogEntity> findPackageTrackList(@RequestParam String orderPackageCode);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java

@ -402,7 +402,7 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
basicdataCodeRecordEntity.setNum(inrc);
basicdataCodeRecordService.updateById(basicdataCodeRecordEntity);
return warehouseCode+year+CommonUtil.geFourNumber(month.longValue(),5)+CommonUtil.geFourNumber(inrc.longValue(),5);
return warehouseCode+year+CommonUtil.geFourNumber(month.longValue(),2)+CommonUtil.geFourNumber(inrc.longValue(),5);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java

@ -326,7 +326,7 @@ public class TripartiteTransferController {
return R.fail(400,"仓库信息为空");
}
return carsLoadService.signLoadScanByIds(loadScanIds);
return carsLoadService.signLoadScanByIds(loadScanIds,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java

@ -109,4 +109,13 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
IPage<TrunklineCarsLoadScanVO> transitOrderPageList(IPage<Object> page, @Param("param") LoadCarsDTO loadCarsDTO);
List<String> findPackageListByLoadId(@Param("loadId") Long loadId);
List<String> findUnloadByLoadIdAndWarehouseId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
void updateScanStatusByLoadId(@Param("loadId") Long loadId, @Param("scanStatus") String scanStatus);
List<String> findSignListOrderPackageCodes(@Param("loadId") Long loadId);
List<String> findSignListOrderPackageCodesByIds(@Param("list") List<Long> loadScanIds);
}

43
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -494,4 +494,47 @@
and is_data = 0
</select>
<select id="findPackageListByLoadId" resultType="String">
select scan_code
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and scan_status = '1'
and `type` = 1
</select>
<select id="findUnloadByLoadIdAndWarehouseId" resultType="String">
select scan_code
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and unload_node_id = #{warehouseId}
and scan_status = '2'
and `type` = 1
</select>
<update id="updateScanStatusByLoadId" >
update logpm_trunkline_cars_load_scan
set scan_status = #{scanStatus}
where load_id = #{loadId}
</update>
<select id="findSignListOrderPackageCodes" resultType="String">
select scan_code
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and scan_status = '3'
and `type` = 1
</select>
<select id="findSignListOrderPackageCodesByIds" resultType="String">
select scan_code
from logpm_trunkline_cars_load_scan
where 1=1
<if test="list != null and list.size() > 0">
and id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IPackageTrackLogAsyncService.java

@ -0,0 +1,9 @@
package com.logpm.trunkline.service;
import java.util.List;
public interface IPackageTrackLogAsyncService {
void addPackageTrackLog(String tenantId, Long userId, Long deptId, String nickName, List<String> orderPackageCodes, Long warehouseId, String warehouseName, Integer workNode, String content);
}

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

@ -104,4 +104,14 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
IPage<TrunklineCarsLoadScanVO> transitOrderPageList(IPage<Object> page, LoadCarsDTO loadCarsDTO);
List<String> findPackageListByLoadId(Long loadId);
List<String> findUnloadByLoadIdAndWarehouseId(Long loadId, Long warehouseId);
void updateScanStatusByLoadId(Long loadId, String scanStatus);
List<String> findSignListOrderPackageCodes(Long loadId);
List<String> findSignListOrderPackageCodesByIds(List<Long> loadScanIds);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java

@ -173,7 +173,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findLoadingListData(LoadCarsDTO loadCarsDTO);
R signLoadScanByIds(List<Long> loadScanIds);
R signLoadScanByIds(List<Long> loadScanIds,Long warehouseId);
R findCarsLoadLogs(LoadCarsDTO loadCarsDTO);

17
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -7,15 +7,16 @@ import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineBillladingPackageEntity;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineBillladingPackageServicie;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
@ -31,6 +32,8 @@ public class InComingServiceImpl implements IInComingService {
private final ITrunklineAdvanceService advanceService;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
private final IBasicdataWarehouseClient warehouseClient;
private final IPackageTrackLogAsyncService packageTrackLogAsyncService;
@Override
public R incomingPackage(InComingDTO inComingDTO) {
@ -93,6 +96,12 @@ public class InComingServiceImpl implements IInComingService {
List<String> incomingWarehouseNames = advanceDetailService.findIncomingWarehouseName(advanceId);
advanceService.updateIncomingWarehouseName(String.join(",",incomingWarehouseNames),advanceId);
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
//存入日志
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(),"包件"+ IncomingTypeEnum.getValue(incomingType));
//2.判断包件和订单是否已经存入在库订单
boolean b = advanceService.saveOrderAndPackage(advanceDetailEntity, warehouseId);

47
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/PackageTrackLogAsyncServiceImpl.java

@ -0,0 +1,47 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.service.IPackageTrackLogAsyncService;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.feign.IWarehousePackageTrackLogClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@Slf4j
@AllArgsConstructor
public class PackageTrackLogAsyncServiceImpl implements IPackageTrackLogAsyncService {
private final IWarehousePackageTrackLogClient warehousePackageTrackLogClient;
@Async
@Override
public void addPackageTrackLog(String tenantId, Long userId, Long deptId, String nickName, List<String> orderPackageCodes, Long warehouseId, String warehouseName, Integer workNode, String content) {
List<WarehousePackageTrackLogEntity> list = new ArrayList<>();
for (String orderPackageCode : orderPackageCodes) {
Date date = new Date();
WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = new WarehousePackageTrackLogEntity();
warehousePackageTrackLogEntity.setTenantId(tenantId);
warehousePackageTrackLogEntity.setCreateUser(userId);
warehousePackageTrackLogEntity.setCreateTime(date);
warehousePackageTrackLogEntity.setUpdateUser(userId);
warehousePackageTrackLogEntity.setUpdateTime(date);
warehousePackageTrackLogEntity.setIsDeleted(0);
warehousePackageTrackLogEntity.setStatus(1);
warehousePackageTrackLogEntity.setCreateDept(deptId);
warehousePackageTrackLogEntity.setOrderPackageCode(orderPackageCode);
warehousePackageTrackLogEntity.setWarehouseId(warehouseId);
warehousePackageTrackLogEntity.setWarehouseName(warehouseName);
warehousePackageTrackLogEntity.setWorkNode(workNode);
warehousePackageTrackLogEntity.setContent(content);
warehousePackageTrackLogEntity.setOperator(nickName);
list.add(warehousePackageTrackLogEntity);
}
warehousePackageTrackLogClient.addLogList(list);
}
}

25
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -253,4 +253,29 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.transitOrderPageList(page,loadCarsDTO);
}
@Override
public List<String> findPackageListByLoadId(Long loadId) {
return baseMapper.findPackageListByLoadId(loadId);
}
@Override
public List<String> findUnloadByLoadIdAndWarehouseId(Long loadId, Long warehouseId) {
return baseMapper.findUnloadByLoadIdAndWarehouseId(loadId,warehouseId);
}
@Override
public void updateScanStatusByLoadId(Long loadId, String scanStatus) {
baseMapper.updateScanStatusByLoadId(loadId,scanStatus);
}
@Override
public List<String> findSignListOrderPackageCodes(Long loadId) {
return baseMapper.findSignListOrderPackageCodes(loadId);
}
@Override
public List<String> findSignListOrderPackageCodesByIds(List<Long> loadScanIds) {
return baseMapper.findSignListOrderPackageCodesByIds(loadScanIds);
}
}

288
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -27,69 +27,11 @@ import com.logpm.factorydata.enums.NodeEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.BatchUnloadDTO;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.LoadScanBrandDTO;
import com.logpm.trunkline.dto.LoadingPackageDTO;
import com.logpm.trunkline.dto.LoadingZeroDTO;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO;
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO;
import com.logpm.trunkline.dto.UnloadPackageDTO;
import com.logpm.trunkline.dto.UnloadZeroDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLogEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.entity.TrunklineCostShareRecordEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineCarsLoadContractService;
import com.logpm.trunkline.service.ITrunklineCarsLoadFinanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLineService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLogService;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineCarsLoadingLogService;
import com.logpm.trunkline.service.ITrunklineCarsOrderService;
import com.logpm.trunkline.service.ITrunklineCarsSignLogService;
import com.logpm.trunkline.service.ITrunklineCarsUnloadLogService;
import com.logpm.trunkline.service.ITrunklineCostShareRecordService;
import com.logpm.trunkline.service.ITrunklineLoadSignOrderService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.CarsLoadOrderInfoVO;
import com.logpm.trunkline.vo.CarsLoadWaybillInfoVO;
import com.logpm.trunkline.vo.HasNotFinalNodeIdDataVO;
import com.logpm.trunkline.vo.LoadScanFinalNodeIdVO;
import com.logpm.trunkline.vo.LoadScanOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.LoadingListGoodsVO;
import com.logpm.trunkline.vo.LoadingListMainVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.OrderScanDetailVO;
import com.logpm.trunkline.vo.SignOrderDetailVO;
import com.logpm.trunkline.vo.SignPackageVO;
import com.logpm.trunkline.vo.SignScanOrderVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadLoadingListVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadScanVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import com.logpm.trunkline.vo.TrunklineLoadSignOrderVO;
import com.logpm.trunkline.vo.UnloadPackageVO;
import com.logpm.trunkline.vo.UnloadScanOrderVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import com.logpm.trunkline.vo.ZeroSuppleVO;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
@ -99,9 +41,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.*;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
@ -119,14 +59,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
@Slf4j
@Service
@ -164,6 +97,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final ITrunklineCostShareRecordService trunklineCostShareRecordService;
private final IAftersalesAbnormalRecordClient abnormalRecordClient;
private final FactoryDataMessageSender factoryDataMessageSender;
private final IPackageTrackLogAsyncService packageTrackLogAsyncService;
@Override
public IPage<TrunklineCarsLoadVO> loadCarsPageList(LoadCarsDTO loadCarsDTO) {
@ -215,6 +149,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long warehouseId = loadCarsDTO.getWarehouseId();
String fullLoadRate = loadCarsDTO.getFullLoadRate();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############startCarByLoadId: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -280,6 +220,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
openOrderAsyncService.saveStartCarLog(carsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"起始仓发车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.INITIAL_WAREHOUSE_DEPART.getCode(),content );
} catch (Exception e) {
log.warn("############startCarByLoadId: 存入日志失败");
@ -357,6 +301,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadAsyncService.saveLog(carsLoadEntity, currentCarsLoadLineEntity, CarsLoadLogTypeConstant.NET_START_CARS_LOAD.getValue(), AuthUtil.getNickName(), AuthUtil.getUserId());
openOrderAsyncService.saveStartCarLog(currentCarsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"网点发车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.TRANSFER_WAREHOUSE_DEPART.getCode(),content );
} catch (Exception e) {
log.warn("############startCarByLoadId: 存入日志失败");
}
@ -377,7 +326,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// 发送消息推送工厂数据
try {
// 查询详细地址为仓库的地址
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(nowWarehouseId);
String warehouseAddress = null;
if (ObjectUtil.isNotEmpty(warehouseEntity)) {
warehouseAddress = "从【" + warehouseEntity.getName() + "】发出";
@ -454,6 +402,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############arriveCarByLoadId: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
log.warn("#############arriveCarByLoadId: 配载计划不存在 loadId={}", loadId);
@ -504,15 +458,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
nextCarsLoadLineEntity.setArriveUserId(AuthUtil.getUserId());
nextCarsLoadLineEntity.setArriveUserName(AuthUtil.getUserName());
trunklineCarsLoadLineService.updateById(nextCarsLoadLineEntity);
Integer workNode = null;
if (!nodeId.equals(endNodeId)) {
carsLoadEntity.setLoadStatus("20");
carsLoadEntity.setArriveTime(date);
carsLoadEntity.setNowWarehouseId(warehouseId);
workNode = WorkNodeEnums.NET_ARRIVE_CAR.getCode();
} else {
carsLoadEntity.setLoadStatus("40");
carsLoadEntity.setArriveTime(date);
carsLoadEntity.setNowWarehouseId(warehouseId);
workNode = WorkNodeEnums.FINAL_NET_ARRIVE_CAR.getCode();
}
updateById(carsLoadEntity);
@ -525,6 +481,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadAsyncService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.END_ARRIVE_CARS_LOAD.getValue(), AuthUtil.getNickName(), AuthUtil.getUserId());
}
openOrderAsyncService.saveArriveCarLog(carsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"到车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), workNode,content );
} catch (Exception e) {
log.warn("#############arriveCarByLoadId: 存入日志失败");
}
@ -538,6 +500,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer startCarType = loadCarsDTO.getStartCarType();
Long warehouseId = loadCarsDTO.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############cancelStartCarByLoadId: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -599,6 +567,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
carsLoadAsyncService.saveLog(carsLoadEntity, currentCarsLoadLineEntity, CarsLoadLogTypeConstant.CANCEL_FIRST_START_CARS_LOAD.getValue(), AuthUtil.getNickName(), AuthUtil.getUserId());
openOrderAsyncService.saveCancelStartCarLog(currentCarsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"始发仓取消发车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_DEPART.getCode(),content );
} catch (Exception e) {
log.warn("#############cancelStartCarByLoadId: 存入日志失败");
}
@ -618,6 +590,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
carsLoadAsyncService.saveLog(carsLoadEntity, currentCarsLoadLineEntity, CarsLoadLogTypeConstant.CANCEL_NET_START_CARS_LOAD.getValue(), AuthUtil.getNickName(), AuthUtil.getUserId());
openOrderAsyncService.saveCancelStartCarLog(currentCarsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"网点取消发车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.CANEL_TRANSFER_WAREHOUSE_DEPART.getCode(),content );
} catch (Exception e) {
log.warn("#############cancelStartCarByLoadId: 存入日志失败");
}
@ -703,6 +680,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.info("############cancelArriveCarByLoadId: 取消到车");
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############cancelArriveCarByLoadId: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -765,10 +749,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentCarsLoadLineEntity.setArriveUserName(null);
trunklineCarsLoadLineService.updateById(currentCarsLoadLineEntity);
Integer workNode = null;
if (startNodeId.equals(aheadNodeId)) {
carsLoadEntity.setLoadStatus("10");
workNode = WorkNodeEnums.CANCEL_NET_ARRIVE_CAR.getCode();
} else {
carsLoadEntity.setLoadStatus("30");
workNode = WorkNodeEnums.CANCEL_FINAL_NET_ARRIVE_CAR.getCode();
}
carsLoadEntity.setNowWarehouseId(aheadNodeId);
carsLoadEntity.setArriveTime(aheadCarsLoadLineEntity.getArriveDate());
@ -788,6 +775,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadAsyncService.saveLog(carsLoadEntity, currentCarsLoadLineEntity, CarsLoadLogTypeConstant.CANCEL_NET_ARRIVE_CARS_LOAD.getValue(), AuthUtil.getNickName(), AuthUtil.getUserId());
}
openOrderAsyncService.saveCancelArriveCarLog(currentCarsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseId+"取消到车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), workNode,content );
} catch (Exception e) {
log.warn("#############cancelArriveCarByLoadId: 存入日志失败");
}
@ -821,6 +812,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
Integer unloadType = loadCarsDTO.getUnloadType();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############unloadByLoadId: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -880,6 +878,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
carsLoadAsyncService.saveLog(carsLoadEntity, currentCarsLoadLineEntity, CarsLoadLogTypeConstant.NET_UNLOAD_CARS_LOAD.getValue(), AuthUtil.getNickName(), AuthUtil.getUserId());
openOrderAsyncService.saveUnloadStartCarLog(currentCarsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId());
} catch (Exception e) {
log.warn("#############unloadByLoadId: 存入日志失败");
}
@ -919,6 +918,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//无装车记录异常日志记录
try {
carsLoadAsyncService.abnormalListUnloadCheckByLoadIdAndWarehouseId(loadId, warehouseId, currentCarsLoadLineEntity.getNodeName(), AuthUtil.getTenantId(), AuthUtil.getUserId(), AuthUtil.getNickName(), Func.firstLong(AuthUtil.getDeptId()));
List<String> orderPackageCodes = trunklineCarsLoadScanService.findUnloadByLoadIdAndWarehouseId(loadId,warehouseId);
String content = "包件在 "+warehouseEntity.getName()+"卸车确认";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), node.getCode(),content );
} catch (Exception e) {
log.warn("###############unloadPackage: 存入异常列表记录失败");
}
@ -939,7 +943,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
// 查询详细地址为仓库的地址
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(nowWarehouseId);
String warehouseAddress = null;
if (ObjectUtil.isNotEmpty(warehouseEntity)) {
warehouseAddress = "到达【" + warehouseEntity.getName() + "】";
@ -1659,6 +1662,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R startCars(Long loadId, Long warehouseId) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############startCars: 仓库信息不存在 warehouseId={}", warehouseId);
return R.fail(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -1699,6 +1708,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.FIRST_START_CARS_LOAD.getValue());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"三方中转发车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.TRIPARTITE_TRANSFER_DEPART.getCode(),content );
} catch (Exception e) {
log.warn("#############startCarByLoadId: 存入日志失败");
}
@ -1706,7 +1721,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
List<LoadScanBrandDTO> brands = this.baseMapper.fingPackageCodeByLoadId(loadId);
// 查询详细地址为仓库的地址
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(nowWarehouseId);
String warehouseAddress = null;
if (ObjectUtil.isNotEmpty(warehouseEntity)) {
warehouseAddress = "从【" + warehouseEntity.getName() + "】发出";
@ -1722,6 +1736,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R cancelStartCars(Long loadId, Long warehouseId) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############cancelStartCars: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -1767,6 +1788,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
trunklineCarsLoadLogService.saveLog(carsLoadEntity, currentCarsLoadLineEntity, CarsLoadLogTypeConstant.CANCEL_FIRST_START_CARS_LOAD.getValue());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"三方中转取消发车";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.CANCEL_TRIPARTITE_TRANSFER_DEPART.getCode(),content );
} catch (Exception e) {
log.warn("#############startCarByLoadId: 存入日志失败");
}
@ -1776,6 +1802,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R arriveCars(Long loadId, Long warehouseId, String arriveDateStr) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############arriveCars: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -1817,6 +1850,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
try {
trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.END_ARRIVE_CARS_LOAD.getValue());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId);
String content = "包件在 "+warehouseEntity.getName()+"三方中转到达";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.ARRICE_TRIPARTITE_TRANSFER_DEPART.getCode(),content );
} catch (Exception e) {
log.warn("#############startCarByLoadId: 存入日志失败");
}
@ -1826,6 +1864,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R signCars(Long loadId, Long warehouseId) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("#############signCars: 仓库信息不存在 warehouseId={}", warehouseId);
throw new CustomerException(400, "仓库信息不存在");
}
//先查询车辆配载计划
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -1846,7 +1891,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setSignTime(new Date());
updateById(carsLoadEntity);
//TODO 装车扫描表状态要改成签收
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId,"3");
try{
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId);
String content = "包件在"+warehouseEntity.getName()+"被三方中转整车签收";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(),content);
}catch (Exception e){
log.warn("###########存入日志失败");
}
return R.success("签收成功");
}
@ -1935,6 +1990,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer isAbnormal = 0;
Long trayId = null;
String trayName = null;
String fromWarehouseName = null;
Long fromWarehouseId = null;
Long loadScanId = null;
@ -2016,6 +2072,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String waybillNumber = otherParcelListEntity.getWaybillNumber();
fromWarehouseId = otherParcelListEntity.getWarehouseId();
orderCode = otherParcelListEntity.getOrderCode();
BasicdataWarehouseEntity fromWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(fromWarehouseId);
if(!Objects.isNull(fromWarehouseEntity)){
fromWarehouseName = fromWarehouseEntity.getName();
}
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
if (Objects.isNull(waybillEntity)) {
log.warn("##################loadingScan: 运单信息不存在 waybillNumber={}", waybillNumber);
@ -2057,6 +2117,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
waybillNo = parcelListEntity.getWaybillNumber();
orderCode = parcelListEntity.getOrderCode();
fromWarehouseId = parcelListEntity.getWarehouseId();
BasicdataWarehouseEntity fromWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(fromWarehouseId);
if(!Objects.isNull(fromWarehouseEntity)){
fromWarehouseName = fromWarehouseEntity.getName();
}
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if (Objects.isNull(waybillEntity)) {
log.warn("##################loadingScan: 运单信息不存在 waybillNo={}", waybillNo);
@ -2118,6 +2182,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanService.save(carsLoadScanEntity);
loadScanId = carsLoadScanEntity.getId();
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 "+warehouseName+"装车,配载计划目的仓 "+carsLoadScanEntity.getFinalNodeName()+",数据来源仓库 "+fromWarehouseName;
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_LOADING.getCode(),content );
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1,
1, isData, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
updateNumByLoadId(loadId);
@ -3416,6 +3486,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long warehouseId = signOrderEntity.getWarehouseId();
String marketName = signOrderEntity.getMallName();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("##############signScanPackageCode: 仓库信息不存在 warehouseId={}", warehouseId);
return R.fail(405, "仓库信息不存在");
}
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
log.warn("##############signScanPackageCode: 配载计划不存在 loadId={}", loadId);
@ -3556,6 +3632,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//重新计算签收单的数量
updateSignOrderNumBySignOrderId(signOrderId);
try{
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 "+warehouseEntity.getName()+"直发商家签收";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.SIGN_DIRECT_SHIPPER.getCode(),content );
}catch (Exception e){
log.warn("###########存入日志信息失败");
}
return R.success("签收成功");
}
@ -3871,8 +3957,29 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
@Override
public R signLoadScanByIds(List<Long> loadScanIds) {
public R signLoadScanByIds(List<Long> loadScanIds,Long warehouseId) {
if(loadScanIds.isEmpty()){
log.warn("############signLoadScanByIds: 数据id为空 loadScanIds={}",loadScanIds);
return R.fail(405,"数据id为空");
}
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("############signLoadScanByIds: 仓库信息不存在 warehouseId={}",warehouseId);
return R.fail(405,"仓库信息不存在");
}
trunklineCarsLoadScanService.updateScanStatus(loadScanIds, "3");
try{
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds);
String content = "包件在"+warehouseEntity.getName()+"被三方中转签收";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseEntity.getName(), WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(),content);
}catch (Exception e){
log.warn("###########存入日志失败");
}
return R.success("签收成功");
}
@ -4267,6 +4374,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer isData = carsLoadScanEntity.getIsData();
if (isData == 1) {
updateNumByLoadId(loadId);
String warehouseName = carsLoadScanEntity.getWarehouseName();
Integer isAbnormal = carsLoadScanEntity.getLoadingAbnormal();
Integer num = carsLoadScanEntity.getNum();
Long trayId = carsLoadScanEntity.getTrayId();
@ -4276,6 +4384,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String scanCode = carsLoadScanEntity.getScanCode();
Integer type = carsLoadScanEntity.getType();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
String fromWarehouseName = null;
BasicdataWarehouseEntity fromWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(fromWarehouseId);
if(!Objects.isNull(fromWarehouseEntity)){
fromWarehouseName = fromWarehouseEntity.getName();
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if (Objects.isNull(stockArticleEntity)) {
@ -4301,10 +4414,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} else {
parcelListEntity.setIsTransfer(1);
}
distributionParcelListClient.update(parcelListEntity);
if (StringUtil.isNotBlank(trayCode)) {
updownTypeClient.downPackageOrDelTray(scanCode, warehouseId, "包件下架解托");
}
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(scanCode);
String content = "包件在 "+warehouseName+"取消装车,配载计划目的仓 "+carsLoadScanEntity.getFinalNodeName();
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseName, WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_LOADING.getCode(),content );
} else {
if (StringUtil.isNotBlank(trayCode)) {
trayTypeClient.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "零担解托");
@ -4761,6 +4881,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
updateNumByLoadId(loadId);
try{
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 "+warehouseName+"卸车,卸车方式:"+ IncomingTypeEnum.getValue(incomingType);
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,warehouseId,warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(),content );
}catch (Exception e){
log.warn("#########3卸车存入日志失败");
}
return R.success("卸车成功");
}

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

@ -1,14 +1,17 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.mapper.TrunklineWaybillPackageMapper;
import com.logpm.trunkline.service.IPackageTrackLogAsyncService;
import com.logpm.trunkline.service.ITrunklineWaybillPackageService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -18,16 +21,26 @@ import java.util.List;
@Service
@AllArgsConstructor
public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<TrunklineWaybillPackageMapper,TrunklineWaybillPackageEntity> implements ITrunklineWaybillPackageService {
private final IPackageTrackLogAsyncService packageTrackLogAsyncService;
@Override
public void saveList(List<TrunklineAdvanceDetailVO> list, WarehouseWaybillEntity waybillEntity) {
Long waybillId = waybillEntity.getId();
String waybillNo = waybillEntity.getWaybillNo();
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
String destinationWarehouseName = waybillEntity.getDestinationWarehouseName();
String destination = waybillEntity.getDestination();
String content = "包件开单,运单号:"+waybillNo+",发站仓:"+departureWarehouseName+",目的仓:"+destinationWarehouseName+",到站:"+destination;
List<String> orderPackageCodes = new ArrayList<>();
List<TrunklineWaybillPackageEntity> ls = new ArrayList<>();
for (TrunklineAdvanceDetailVO trunklineAdvanceDetailVO : list) {
Long advanceDetailId = trunklineAdvanceDetailVO.getId();
Long advanceId = trunklineAdvanceDetailVO.getAdvanceId();
String orderCode = trunklineAdvanceDetailVO.getOrderCode();
String orderPackageCode = trunklineAdvanceDetailVO.getOrderPackageCode();
Long waybillId = waybillEntity.getId();
String waybillNo = waybillEntity.getWaybillNo();
TrunklineWaybillPackageEntity waybillPackageEntity = new TrunklineWaybillPackageEntity();
waybillPackageEntity.setWaybillId(waybillId);
waybillPackageEntity.setWaybillNo(waybillNo);
@ -37,7 +50,10 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
waybillPackageEntity.setOrderPackageCode(orderPackageCode);
waybillPackageEntity.setIsSignfor(0);
ls.add(waybillPackageEntity);
orderPackageCodes.add(orderPackageCode);
}
saveBatch(ls);
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(),AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()),AuthUtil.getNickName(),orderPackageCodes,departureWarehouseId,departureWarehouseName, WorkNodeEnums.BILLING.getCode(),content );
}
}

73
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehousePackageTrackLogController.java

@ -0,0 +1,73 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.warehouse.dto.WarehousePackageTrackLogDTO;
import com.logpm.warehouse.service.IWarehousePackageTrackLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
/**
* 运单表 控制器
*
* @author zhy
* @since 2023-07-10
*/
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/packageTrackLog")
@Api(value = "包件跟踪日志表", tags = "包件跟踪日志接口")
public class WarehousePackageTrackLogController extends BladeController {
private final IWarehousePackageTrackLogService warehousePackageTrackLogService;
@ResponseBody
@PostMapping("/finaPackageTrackLogList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询包件跟踪日志列表", notes = "传入packageTrackLogDTO")
public R finaPackageTrackLogList(@RequestBody WarehousePackageTrackLogDTO packageTrackLogDTO) {
String method = "############finaPackageTrackLogList: ";
log.info(method + "请求参数{}", packageTrackLogDTO);
String orderPackageCode = packageTrackLogDTO.getOrderPackageCode();
try{
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包件码不能为空 orderPackageCode={}",orderPackageCode);
return R.fail(405,"包件码不能为空");
}
return warehousePackageTrackLogService.finaPackageTrackLogList(orderPackageCode);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehousePackageTrackLogDTO.java

@ -0,0 +1,12 @@
package com.logpm.warehouse.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class WarehousePackageTrackLogDTO implements Serializable {
private String orderPackageCode;
}

39
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehousePackageTrackLogClient.java

@ -0,0 +1,39 @@
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.service.IWarehousePackageTrackLogService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class WarehousePackageTrackLogClient implements IWarehousePackageTrackLogClient {
private final IWarehousePackageTrackLogService warehousePackageTrackLogService;
@Override
public void addLog(WarehousePackageTrackLogEntity packageTrackLogEntity) {
warehousePackageTrackLogService.save(packageTrackLogEntity);
}
@Override
public void addLogList(List<WarehousePackageTrackLogEntity> packageTrackLogEntityList) {
warehousePackageTrackLogService.saveBatch(packageTrackLogEntityList);
}
@Override
public List<WarehousePackageTrackLogEntity> findPackageTrackList(String orderPackageCode) {
QueryWrapper<WarehousePackageTrackLogEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_package_code",orderPackageCode)
.orderByAsc("create_time");
return warehousePackageTrackLogService.list(queryWrapper);
}
}

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehousePackageTrackLogMapper.java

@ -0,0 +1,12 @@
package com.logpm.warehouse.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface WarehousePackageTrackLogMapper extends BaseMapper<WarehousePackageTrackLogEntity> {
}

9
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehousePackageTrackLogService.java

@ -0,0 +1,9 @@
package com.logpm.warehouse.service;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IWarehousePackageTrackLogService extends BaseService<WarehousePackageTrackLogEntity> {
R finaPackageTrackLogList(String orderPackageCode);
}

26
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehousePackageTrackLogServiceImpl.java

@ -0,0 +1,26 @@
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.mapper.WarehousePackageTrackLogMapper;
import com.logpm.warehouse.service.IWarehousePackageTrackLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
@Slf4j
public class WarehousePackageTrackLogServiceImpl extends BaseServiceImpl<WarehousePackageTrackLogMapper, WarehousePackageTrackLogEntity> implements IWarehousePackageTrackLogService {
@Override
public R finaPackageTrackLogList(String orderPackageCode) {
QueryWrapper<WarehousePackageTrackLogEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_package_code",orderPackageCode)
.orderByAsc("create_time");
return R.data(baseMapper.selectList(queryWrapper));
}
}
Loading…
Cancel
Save