Browse Source

1.修改同步老系统托盘数据的效率

2.拉取同步订单可以按照运单拉取
3.修复干线bug
master
zhenghaoyu 10 months ago
parent
commit
6c777bcbbb
  1. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java
  2. 5
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java
  3. 1
      blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java
  4. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java
  5. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java
  6. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java
  7. 7
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
  8. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java
  9. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java
  10. 29
      blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java
  11. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  12. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  13. 25
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java

@ -100,4 +100,7 @@ public interface IAdvanceClient {
@PostMapping(API_PREFIX + "/findListByAdvanceIds") @PostMapping(API_PREFIX + "/findListByAdvanceIds")
List<AdvanceEntity> findListByAdvanceIds(@RequestBody List<Integer> advanceIds); List<AdvanceEntity> findListByAdvanceIds(@RequestBody List<Integer> advanceIds);
@PostMapping(API_PREFIX + "/findListByWaybillNo")
List<String> findListByWaybillNo(@RequestParam String waybillNo);
} }

5
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java

@ -60,6 +60,11 @@ public class IAdvanceClientFallbackFactory implements FallbackFactory<IAdvanceCl
public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) { public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) {
return null; return null;
} }
@Override
public List<String> findListByWaybillNo(String waybillNo) {
return null;
}
}; };
} }
} }

1
blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java

@ -15,5 +15,6 @@ public class SyncInventoryDTO implements Serializable {
private Long warehouseId; private Long warehouseId;
private String orderCodes; private String orderCodes;
private Integer syncType;
} }

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java

@ -15,6 +15,7 @@ public class CarsLoadWaybillInfoVO implements Serializable {
private Date createTime; private Date createTime;
private String destination; private String destination;
private String destinationWarehouseName; private String destinationWarehouseName;
private Integer checkStatus;
private String shipper; private String shipper;
private String shipperName; private String shipperName;
private String consignee; private String consignee;

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java

@ -112,4 +112,9 @@ public class AdvanceClient implements IAdvanceClient {
return list; return list;
} }
@Override
public List<String> findListByWaybillNo(String waybillNo) {
return service.findListByWaybillNo(waybillNo);
}
} }

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java

@ -54,4 +54,6 @@ public interface AdvanceMapper {
List<AdvanceEntity> getAdvanceList(@Param("orderSelfNum") String orderSelfNum); List<AdvanceEntity> getAdvanceList(@Param("orderSelfNum") String orderSelfNum);
List<AdvanceEntity> findListByAdvanceIds(@Param("advanceIds") List<Integer> advanceIds); List<AdvanceEntity> findListByAdvanceIds(@Param("advanceIds") List<Integer> advanceIds);
List<String> findListByWaybillNo(@Param("waybillNo") String waybillNo);
} }

7
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml

@ -82,4 +82,11 @@
</if> </if>
</select> </select>
<select id="findListByWaybillNo" resultType="String">
select orderSelfNum
from ht_advance
where delete_time = 0
and waybill_no = #{waybillNo}
</select>
</mapper> </mapper>

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java

@ -54,4 +54,6 @@ public interface IAdvanceService {
List<AdvanceEntity> getAdvanceList(String orderSelfNum); List<AdvanceEntity> getAdvanceList(String orderSelfNum);
List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds); List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds);
List<String> findListByWaybillNo(String waybillNo);
} }

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java

@ -87,4 +87,9 @@ public class AdvanceServiceImpl implements IAdvanceService {
public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) { public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) {
return advanceMapper.findListByAdvanceIds(advanceIds); return advanceMapper.findListByAdvanceIds(advanceIds);
} }
@Override
public List<String> findListByWaybillNo(String waybillNo) {
return advanceMapper.findListByWaybillNo(waybillNo);
}
} }

29
blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.oldproject.feign.IAdvanceClient;
import com.logpm.patch.dto.SyncInventoryDTO; import com.logpm.patch.dto.SyncInventoryDTO;
import com.logpm.patch.entity.SyncInventoryEntity; import com.logpm.patch.entity.SyncInventoryEntity;
import com.logpm.patch.service.ISyncOrderInfoService; import com.logpm.patch.service.ISyncOrderInfoService;
@ -30,6 +31,7 @@ public class SyncOrderInfoController {
private final IBasicdataWarehouseClient warehouseClient; private final IBasicdataWarehouseClient warehouseClient;
private final ISyncOrderInfoService syncOrderInfoService; private final ISyncOrderInfoService syncOrderInfoService;
private final IAdvanceClient advanceClient;
@ResponseBody @ResponseBody
@PostMapping("/syncOrder") @PostMapping("/syncOrder")
@ -40,6 +42,7 @@ public class SyncOrderInfoController {
try{ try{
String orderCodes = syncInventoryDTO.getOrderCodes(); String orderCodes = syncInventoryDTO.getOrderCodes();
Integer syncType = syncInventoryDTO.getSyncType();//1订单 2 运单
if(StringUtil.isBlank(orderCodes)){ if(StringUtil.isBlank(orderCodes)){
log.warn(method+"订单号不能为空 orderCodes={}",orderCodes); log.warn(method+"订单号不能为空 orderCodes={}",orderCodes);
@ -51,16 +54,34 @@ public class SyncOrderInfoController {
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空"); return R.fail(403,"仓库信息为空");
} }
if(Objects.isNull(syncType)){
log.warn(method+"数据类型不能为空 syncType={}",syncType);
return R.fail(403,"数据类型不能为空");
}
Long warehouseId = myCurrentWarehouse.getId(); Long warehouseId = myCurrentWarehouse.getId();
log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,myCurrentWarehouse.getOldId()); log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,myCurrentWarehouse.getOldId());
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(warehouseId); BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(warehouseId);
log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,entityWarehouseId.getOldId()); log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,entityWarehouseId.getOldId());
List<String> orderCodeList = new ArrayList<>();
String[] split = orderCodes.split(","); if(syncType.equals(1)){
//订单
List<String> orderCodeList = new ArrayList<>(Arrays.asList(split)); String[] split = orderCodes.split(",");
List<String> list = Arrays.asList(split);
orderCodeList.addAll(list);
}else if(syncType.equals(2)){
//运单
List<String> list = advanceClient.findListByWaybillNo(orderCodes);
orderCodeList.addAll(list);
}else{
log.warn(method+"数据类型不正确 syncType={}",syncType);
return R.fail(403,"数据类型不正确");
}
log.info(method+"当前处理的订单 orderCodeList={}",orderCodeList);
syncOrderInfoService.handleData(orderCodeList,entityWarehouseId.getOldId(),warehouseId,null,null); syncOrderInfoService.handleData(orderCodeList,entityWarehouseId.getOldId(),warehouseId,null,null);

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml

@ -109,6 +109,7 @@
wb.create_time createTime, wb.create_time createTime,
wb.destination destination, wb.destination destination,
wb.destination_warehouse_name destinationWarehouseName, wb.destination_warehouse_name destinationWarehouseName,
IF(wb.check_user_id IS NULL , 0,1) checkStatus,
wb.shipper shipper, wb.shipper shipper,
wb.shipper_name shipperName, wb.shipper_name shipperName,
wb.consignee consignee, wb.consignee consignee,

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

@ -2911,17 +2911,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadWaybillInfoVO.setOpenPrice(openPrice); carsLoadWaybillInfoVO.setOpenPrice(openPrice);
carsLoadWaybillInfoVO.setGoodsName(productNames); carsLoadWaybillInfoVO.setGoodsName(productNames);
List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo); // List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo);
// List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo); List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo);
carsLoadOrderInfoList.forEach(carsLoadOrderInfoVO -> { carsLoadOrderInfoListPlan.forEach(carsLoadOrderInfoVO -> {
carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP)); carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP));
carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP)); carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP));
}); });
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoList); carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoListPlan);
// carsLoadWaybillInfoVO.setCarsLoadOrderInfoListPlan(carsLoadOrderInfoListPlan); // carsLoadWaybillInfoVO.setCarsLoadOrderInfoListPlan(carsLoadOrderInfoListPlan);
TrunklineCostShareRecordEntity costShareRecordEntity = trunklineCostShareRecordService.findTotalUnloadNumByLoadAndWaybillNo(loadId, waybillNo); TrunklineCostShareRecordEntity costShareRecordEntity = trunklineCostShareRecordService.findTotalUnloadNumByLoadAndWaybillNo(loadId, waybillNo);

25
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -3922,10 +3922,29 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
log.warn("##############syncOldTrayData: 空置失败"); log.warn("##############syncOldTrayData: 空置失败");
} }
//批量打托 BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
for (String orderPackageCode : orderPackageCodes) {
orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId,remark); FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(orderPackageCodes);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
if(parcelListEntityList.isEmpty()){
log.warn("##############syncOldTrayData: 包件数据不存在");
return R.fail(405,"没有可以同步的包件");
} }
DistributionParcelListEntity parcelListEntity = parcelListEntityList.get(0);
String orderCode = parcelListEntity.getOrderCode();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findByOrderSelfNum(orderCode, warehouseId);
Long trayId = trayEntity.getId();
WarehouseTrayTypeEntity trayTypeEntity = saveTrayTypeByOrderPackageCode(trayType, trayCode, trayId, parcelListEntity, stockArticleEntity, warehouseId);
orderScanOrderPackageCodeList(trayTypeEntity, parcelListEntityList, warehouseId,"同步老系统托盘数据");
//批量打托
// for (String orderPackageCode : orderPackageCodes) {
// orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId,remark);
// }
return R.success("打托成功"); return R.success("打托成功");
} }

Loading…
Cancel
Save