Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dist.1.3.0
zhaoqiaobo 11 months ago
parent
commit
437b8fcc26
  1. 12
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java
  2. 9
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  3. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelListVO.java
  4. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java
  5. 12
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  6. 6
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java
  7. 9
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java
  8. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java
  9. 15
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java
  10. 12
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java
  11. 6
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  12. 9
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  13. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java
  14. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  15. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  16. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  17. 310
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  18. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  19. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  20. 23
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java
  21. 120
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  22. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  23. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  24. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java
  25. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  26. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  27. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  28. 71
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  29. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  30. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.java
  31. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml
  32. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java
  33. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  34. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  35. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java
  36. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  37. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillOrderService.java
  38. 31
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  39. 16
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  40. 299
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  41. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  42. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  43. 84
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  44. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  45. 53
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  46. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillOrderServiceImpl.java
  47. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java
  48. 31
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java
  49. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailMapper.java
  50. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillDetailMapper.xml
  51. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  52. 94
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  53. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailService.java
  54. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  55. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailServiceImpl.java
  56. 36
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

12
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java

@ -127,6 +127,18 @@ public class AftersalesAbnormalPackageEntity extends TenantEntity {
*/
@ApiModelProperty(value = "物料编码(库存品)")
private String cargoNumber;
/**
* 一级品
*/
@ApiModelProperty(value = "一级品")
private String first;
/**
* 二级品
*/
@ApiModelProperty(value = "二级品")
private String secondary;
/**
* 入库批次号库存品)
*/

9
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -155,4 +155,13 @@ public interface IDistributionParcelListClient {
@PostMapping(API_PREFIX+"/updateList")
void updateList(@RequestBody List<DistributionParcelListEntity> updateParcelList);
@PostMapping(API_PREFIX+"/updateFreezeStatusByWaybillIds")
void updateFreezeStatusByWaybillIds(@RequestBody List<Long> waybillIds);
@PostMapping(API_PREFIX+"/updateUnFreezeStatusByWaybillIds")
void updateUnFreezeStatusByWaybillIds(@RequestBody List<Long> waybillIds);
@PostMapping(API_PREFIX+"/clearParceListWaybillByAdvanceIds")
void clearParceListWaybillByAdvanceIds(@RequestBody List<Long> advanceIds);
}

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelListVO.java

@ -80,10 +80,10 @@ public class DistributionParcelListVO extends DistributionParcelListEntity {
*/
private String trayMsg;
/**
* 装车操作人
*/
private String scanUser;
// /**
// * 装车操作人
// */
// private String scanUser;
/**
* 装车操作人

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/BillladingDTO.java

@ -53,4 +53,6 @@ public class BillladingDTO extends TrunklineBillladingEntity {
private String remark;//备注
private String destinationWarehouseName;//目的仓
private Long billladingId;
}

12
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -55,9 +55,11 @@ public class LoadCarsDTO implements Serializable {
private String orderCode;
private String trayCode;
private String trayName;
private String trayType;
private Integer isZero;
private String scanCode;
private String scanStatus;
private List<LoadingPackageDTO> packageList = new ArrayList<>();
private List<LoadingZeroDTO> zeroList = new ArrayList<>();
@ -123,4 +125,14 @@ public class LoadCarsDTO implements Serializable {
private Integer isTransfer = 0;
private String loadingUserName;
private String finalNodeName;
private String unloadNodeName;
private String unloadUserName;
private Integer isData;
private Integer loadingAbnormal;
private Integer unloadAbnormal;
private Integer isSupple;
}

6
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java

@ -149,4 +149,10 @@ public class OpenOrderDTO implements Serializable {
private List<Long> warehouseIds;
private List<Long> waybillIds;
private Integer isEdit;
}

9
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java

@ -202,4 +202,13 @@ public class TrunklineCarsLoadEntity extends TenantEntity {
/** 直发商家个数 */
@ApiModelProperty(name = "直发商家个数",notes = "")
private Integer customerNum;
/** 司机类型 1-自有,2-加盟,3-外调,4-临调*/
@ApiModelProperty(name = "直发商家个数",notes = "")
private String driverType;
/** 外请人*/
@ApiModelProperty(name = "外请人",notes = "")
private String outDriverPerson;
}

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java

@ -127,4 +127,8 @@ public class TrunklineCarsLoadScanEntity extends TenantEntity {
@ApiModelProperty(name = "卸车人名称",notes = "")
private String unloadUserName;
/** 卸车时间 */
@ApiModelProperty(name = "卸车时间",notes = "")
private Date unloadTime;
}

15
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java

@ -469,4 +469,19 @@ public class WarehouseWaybillEntity extends TenantEntity {
@ApiModelProperty(value = "提货车型 ")
private String pickupVehicleType;
@ApiModelProperty(value = "作废状态 0否 1是 ")
private Integer abolishStatus;
@ApiModelProperty(value = "作废人名称 ")
private String abolishUserName;
@ApiModelProperty(value = "作废时间 ")
private Date abolishTime;
@ApiModelProperty(value = "冻结人名称 ")
private String freezeUserName;
@ApiModelProperty(value = "冻结时间 ")
private Date freezeTime;
}

12
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java

@ -71,4 +71,16 @@ public interface IWarehouseWaybillClient {
@GetMapping(API_PREFIX + "/findLastData")
Long findLastData(@RequestParam String waybillNo);
@PostMapping(API_PREFIX + "/findListByWaybillIds")
List<WarehouseWaybillEntity> findListByWaybillIds(@RequestBody List<Long> waybillIds);
@PostMapping(API_PREFIX + "/updateList")
void updateList(@RequestBody List<WarehouseWaybillEntity> waybillEntities);
@PostMapping(API_PREFIX + "/findFreezeOrAbolishByWaybillNos")
List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(@RequestBody List<String> waybillNos);
@PostMapping(API_PREFIX + "/updateWaybillFreezeStatusByWaybillIds")
void updateWaybillFreezeStatusByWaybillIds(@RequestBody List<Long> waybillIds);
}

6
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -654,9 +654,9 @@ public class AftersalesWorkOrderController extends BladeController {
if(ObjectUtils.isNull( aftersalesWorkOrder.getOrderCode()) ){
throw new ServiceException("订单自编号未填!");
}
if(ObjectUtils.isNull( aftersalesWorkOrder.getFirst()) ){
throw new ServiceException("一级品类未填!");
}
// if(ObjectUtils.isNull( aftersalesWorkOrder.getFirst()) ){
// throw new ServiceException("一级品类未填!");
// }
// if(ObjectUtils.isNull( aftersalesWorkOrder.getSecondary()) ){
// throw new ServiceException("二级品类未填!");
// }

9
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -53,6 +53,7 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User;
@ -323,6 +324,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
@Override
@Transactional
public boolean extractedSaveAndUpdate(AftersalesWorkOrderDTO aftersalesWorkOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) {
if (ObjectUtils.isNull(aftersalesWorkOrder.getId())) {
//新增
@ -417,6 +419,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//添加包件信息
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getPackageEntityList())) {
List<AftersalesAbnormalPackageEntity> packageEntityList = aftersalesWorkOrder.getPackageEntityList();
if (!packageEntityList.isEmpty()){
List<String> collect = packageEntityList.stream().filter(f -> Objects.isNull(f.getFirst())).map(AftersalesAbnormalPackageEntity::getPackageCode).collect(Collectors.toList());
if (!collect.isEmpty()){
throw new RuntimeException(collect.stream().collect(Collectors.joining(","))+"无一级品信息");
}
}
//包件信息
List<AftersalesAbnormalPackageEntity> list = new ArrayList<>();
aftersalesWorkOrder.getPackageEntityList().forEach(i -> {

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java

@ -76,6 +76,7 @@ public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient
jsonObject.put("driverId",driverArteryEntity.getId());
jsonObject.put("driverName",driverArteryEntity.getName());
jsonObject.put("driverPhone",driverArteryEntity.getPhone());
jsonObject.put("driverType",driverArteryEntity.getType());
list.add(jsonObject);
}
return list;

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -88,6 +88,7 @@
lbc.blade_region_province_id bladeRegionProvinceId,
lbc.blade_region_city_id bladeRegionCityId,
lbc.blade_region_area_id bladeRegionAreaId,
lbc.default_payment_methods defaultPaymentMethods,
lbsc.linkman linkman,
lbsc.phone phone,
lbc.detailedly detailedly

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java

@ -361,4 +361,19 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
});
}
@Override
public void updateFreezeStatusByWaybillIds(List<Long> waybillIds) {
distributionParcelListService.updateFreezeStatusByWaybillIds(waybillIds);
}
@Override
public void updateUnFreezeStatusByWaybillIds(List<Long> waybillIds) {
distributionParcelListService.updateUnFreezeStatusByWaybillIds(waybillIds);
}
@Override
public void clearParceListWaybillByAdvanceIds(List<Long> advanceIds) {
distributionParcelListService.clearParceListWaybillByAdvanceIds(advanceIds);
}
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -108,7 +108,7 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<DistributionParcelListEntity> getParcelListInfo(@Param("param")DistributionParcelListVO parcelListVO);
List<DistributionParcelListExcel> exportDistributionParcelList(@Param("paramMap")Map<String, Object> paramMap, @Param("idArr") List<String> idArr);
List<DistributionParcelListExcel> exportDistributionParcelList(@Param("param")Map<String, Object> paramMap, @Param("idArr") List<String> idArr);
void freezeByOrderCode(@Param("orderCode") String orderCode,@Param("freezeStatus") String freezeStatus);
@ -263,4 +263,11 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
void updatePackageStatus(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId, @Param("packageStatus") String packageStatus);
List<DistributionParcelListEntity> findListByOrderPackageCode(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId);
void updateFreezeStatusByWaybillIds(@Param("waybillIds") List<Long> waybillIds);
void updateUnFreezeStatusByWaybillIds(@Param("waybillIds") List<Long> waybillIds);
void clearParceListWaybillByAdvanceIds(@Param("advanceIds") List<Long> advanceIds);
}

310
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -299,13 +299,6 @@
<if test="param.startWarehouseEntryTimeEnd != null and param.startWarehouseEntryTimeEnd !='' and param.lastWarehouseEntryTimeEnd !=''and param.lastWarehouseEntryTimeEnd != null">
and ldpl.warehouse_entry_time_end BETWEEN #{param.startWarehouseEntryTimeEnd} AND #{param.lastWarehouseEntryTimeEnd}
</if>
<!-- <if test="param.startLoadingTime != null and param.lastLoadingTime != null and param.startLoadingTime != '' and param.lastLoadingTime != ''">-->
<!-- AND ldl.scan_time BETWEEN #{param.startLoadingTime} AND #{param.lastLoadingTime}-->
<!-- </if>-->
<!-- <if test="param.startSigningTime != null and param.lastSigningTime != null and param.startSigningTime != '' and param.lastSigningTime != ''">-->
<!-- AND ldl.signing_time BETWEEN #{param.startSigningTime} AND #{param.lastSigningTime}-->
<!-- </if>-->
</where>
</select>
@ -893,55 +886,244 @@
<select id="exportDistributionParcelList"
resultType="com.logpm.distribution.excel.DistributionParcelListExcel">
SELECT
ldpl.warehouse_id warehouseId,
ldpl.id id,
lww.name warehouse,
ldpl.conditions conditions,
ldpl.order_package_code orderPackageCode,
ldpl.firsts firsts,
ldpl.second second,
ldpl.third_product thirdProduct,
ldpl.quantity quantity,
ldpl.train_number trainNumber,
ldpl.stock_article_id stockArticleId,
ldpl.order_code orderCode,
ldpl.service_number serviceNumber,
ldpl.material_id materialId,
ldpl.material_name materialName,
ldpl.brand_name brandName,
ldpl.order_package_freeze_status orderPackageFreezeStatus,
ldpl.order_package_grounding_status orderPackageGroundingStatus,
ldpl.order_package_stockup_status orderPackageStockupStatus,
ldpl.order_package_reservation_status orderPackageReservationStatus,
ldpl.order_package_loading_status orderPackageLoadingStatus,
ldpl.waybill_number waybillNumber,
ldpl.warehouse_entry_time_end warehouseEntryTimeEnd,
ldpl.waybill_number waybillNumber,
lwug.position_code goodsAllocation,
lwtg.tray_code pallet
ldpl.warehouse_id warehouseId,
ldpl.id id,
lww.name warehouse,
ldpl.conditions conditions,
ldpl.order_package_code orderPackageCode,
ldpl.firsts firsts,
ldpl.second second,
ldpl.third_product thirdProduct,
ldpl.quantity quantity,
ldpl.train_number trainNumber,
ldpl.stock_article_id stockArticleId,
ldpl.order_code orderCode,
ldpl.service_number serviceNumber,
ldpl.material_id materialId,
ldpl.material_name materialName,
ldpl.material_code materialCode,
ldpl.brand_name brandName,
ldpl.order_package_status orderPackageStatus,
ldpl.order_package_freeze_status orderPackageFreezeStatus,
ldpl.order_package_grounding_status orderPackageGroundingStatus,
ldpl.order_package_stockup_status orderPackageStockupStatus,
ldpl.order_package_reservation_status orderPackageReservationStatus,
ldpl.order_package_loading_status orderPackageLoadingStatus,
ldpl.warehouse_entry_time_end warehouseEntryTimeEnd,
ldpl.waybill_number waybillNumber,
ldsa.type_service typeService,
ldpl.order_code,
IF(c.reservation_code is not null,c.reservation_code,IF(b.pickup_batch is not null,b.pickup_batch,a.reservation_code)) AS reservationCode,
IF(c.driver_name is not null,c.driver_name,IF(b.consignee is not null,b.consignee,a.driver_name)) AS driverName,
IF(c.vehicle_name is not null,c.vehicle_name,IF(b.pick_up_plate is not null,b.pick_up_plate,a.vehicle_name)) AS vehicleName,
IF(c.train_number is not null,c.train_number,IF(b.train_number is not null,b.train_number,a.train_number)) AS dvehicleName,
IF(c.scan_user is not null,c.scan_user,IF(b.scan_user is not null,b.scan_user,a.scan_user)) AS scanUser,
IF(c.signing_user is not null,c.signing_user,IF(b.signing_user is not null,b.signing_user,a.signing_user)) AS signingUser,
IF(c.scan_time is not null,c.scan_time,IF(b.scan_time is not null,b.scan_time,a.scan_time)) AS loadingTime,
IF(c.signing_time is not null,c.signing_time,IF(b.signing_time is not null,b.signing_time,a.signing_time)) AS signingTime,
m.qr_code AS goodsAllocation,
n.pallet_name AS pallet
FROM
logpm_platform.logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_platform.logpm_warehouse_updown_goods lwug ON ldpl.id = lwug.association_id
LEFT JOIN logpm_platform.logpm_warehouse_tray_goods lwtg ON ldpl.id = lwtg.association_id
Left join logpm_platform.logpm_warehouse_warehouse lww on lww.id = ldpl.warehouse_id
logpm_distribution_parcel_list AS ldpl
LEFT JOIN logpm_warehouse_updown_goods lwug ON ldpl.id = lwug.association_id
LEFT JOIN logpm_warehouse_tray_goods lwtg ON ldpl.id = lwtg.association_id
LEFT join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
LEFT join logpm_warehouse_warehouse lww on lww.id = ldpl.warehouse_id
LEFT JOIN (SELECT lwug.association_id,lwga.qr_code,lwug.is_deleted FROM logpm_warehouse_updown_goods AS lwug LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id ) AS m ON m.association_id = ldpl.id
LEFT JOIN (SELECT lwtg.association_id,lwt.pallet_name,lwtg.is_deleted FROM logpm_warehouse_tray_goods AS lwtg LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id) AS n ON n.association_id = ldpl.id
LEFT JOIN
(SELECT
ldrp.parce_list_id,
ldl.scan_time,
lddl.train_number,
lddl.driver_name,
lddl.vehicle_name,
ldl.signing_time,
ldl.scan_user,
ldl.signing_user,
ldr.reservation_code
FROM logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_distribution_loadscan ldl on ldl.package_id = ldrp.parce_list_id and ldl.scan_status !=1 AND ldl.is_deleted = 0
LEFT JOIN logpm_distribution_reservation ldr on ldr.id = ldrp.reservation_id
LEFT JOIN logpm_distribution_signfor AS lds ON lds.reservation_id = ldr.id
LEFT JOIN logpm_distribution_delivery_list lddl on lds.delivery_id =lddl.id
<where>
ldrp.packet_bar_status != '2'
<if test="param.reservationCode !='' and param.reservationCode != null">
and ldr.reservation_code like concat(#{param.reservationCode},'%')
</if>
<if test="param.scanTime !='' and param.scanTime != null">
and date_format(from_unixtime(ldl.scan_time),'%Y-%m-%d') = date_format(#{param.scanTime}),'%Y-%m-%d')
</if>
<if test="param.signingTime !='' and param.signingTime != null">
and date_format(from_unixtime(ldl.signing_time),'%Y-%m-%d') = date_format(#{param.signingTime}),'%Y-%m-%d')
</if>
<if test="param.dvehicleName !='' and param.dvehicleName != null">
and lddl.train_number = #{param.dvehicleName}
</if>
<if test="param.vehicleName !='' and param.vehicleName != null">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.vehicleName !='' and param.vehicleName != null">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.driverName !='' and param.driverName != null">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
<if test="param.scanUser !='' and param.scanUser != null">
and ldl.scan_user like concat('%',#{param.scanUser},'%')
</if>
<if test="param.signingUser !='' and param.signingUser != null">
and ldl.signing_user like concat('%',#{param.signingUser},'%')
</if>
</where>
) AS a ON a.parce_list_id = ldpl.id
LEFT JOIN (
SELECT
ldbp.parce_list_id,
ldbl.pickup_batch,
ldbl.pickup_batch AS train_number,
ldbl.pick_up_plate AS pick_up_plate,
ldbl.consignee AS consignee,
ldbls.create_time AS scan_time,
ldbls.create_time AS signing_time,
ldbls.scan_user AS scan_user,
ldbls.scan_user AS signing_user
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distrilbution_bill_lading ldbl ON ldbl.id = ldbp.bill_lading_id
LEFT JOIN logpm_distribution_bill_lading_scan ldbls ON ldbls.parcel_list_id = ldbp.parce_list_id
<where>
ldbp.packet_bar_status != '2'
<if test="param.reservationCode !='' and param.reservationCode != null">
and ldbl.pickup_batch like concat(#{param.reservationCode},'%')
</if>
<if test="param.scanTime !='' and param.scanTime != null">
and date_format(from_unixtime(ldl.created_time),'%Y-%m-%d') = date_format(#{param.scanTime}),'%Y-%m-%d')
</if>
<if test="param.signingTime !='' and param.signingTime != null">
and date_format(from_unixtime(ldl.created_time),'%Y-%m-%d') = date_format(#{param.signingTime}),'%Y-%m-%d')
</if>
<if test="param.dvehicleName !='' and param.dvehicleName != null">
and ldbl.pickup_batch = #{param.dvehicleName}
</if>
<if test="param.vehicleName !='' and param.vehicleName != null">
and ldbl.pick_up_plate like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.driverName !='' and param.driverName != null">
and lddl.consignee like concat('%',#{param.driverName},'%')
</if>
<if test="param.scanUser !='' and param.scanUser != null">
and ldbls.scan_user like concat('%',#{param.scanUser},'%')
</if>
<if test="param.signingUser !='' and param.signingUser != null">
and ldbls.scan_user like concat('%',#{param.signingUser},'%')
</if>
</where>
) AS b ON b.parce_list_id = ldpl.id
LEFT JOIN (
SELECT
ldrzp.parcel_list_id,
IF(lddl.train_number is not null,lddl.train_number,ldbl.pickup_batch) AS train_number,
IF(lddl.driver_name is not null,lddl.driver_name,ldbl.consignee) AS driver_name,
IF(lddl.vehicle_name is not null,lddl.vehicle_name,ldbl.pick_up_plate) AS vehicle_name,
IF(ldl.signing_time is not null,ldl.signing_time,ldbls.create_time) AS signing_time,
IF(ldl.scan_time is not null,ldl.scan_time,ldbls.create_time) AS scan_time,
IF(ldl.scan_user is not null,ldl.scan_user,ldbls.scan_user) AS scan_user,
IF(ldl.signing_user is not null,ldl.signing_user,ldbls.scan_user) AS signing_user,
IF(ldr.reservation_code is not null,ldr.reservation_code,ldbl.pickup_batch) AS reservation_code
FROM logpm_distribution_reservation_zero_package ldrzp
LEFT JOIN logpm_distribution_loadscan ldl on ldl.package_id = ldrzp.parcel_list_id and ldl.scan_status !=1 AND ldl.is_deleted = 0
LEFT JOIN logpm_distribution_reservation ldr on ldr.id = ldrzp.reservation_id
LEFT JOIN logpm_distribution_signfor AS lds ON lds.reservation_id = ldr.id
LEFT JOIN logpm_distribution_delivery_list lddl on lds.delivery_id =lddl.id
LEFT JOIN logpm_distrilbution_bill_lading ldbl ON ldrzp.reservation_id = ldbl.id
LEFT JOIN logpm_distribution_bill_lading_scan ldbls ON ldbls.parcel_list_id = ldrzp.parcel_list_id
) AS c ON c.parcel_list_id = ldpl.id
<where>
ldpl.is_deleted = 0
<if test="paramMap.warehouseId != null and paramMap.warehouseId != ''">
and ldpl.warehouse_id = #{paramMap.warehouseId}
<if test="param.warehouse !='' and param.warehouse != null">
and lww.name like concat('%',#{param.warehouse},'%')
</if>
<if test="param.pallet !='' and param.pallet != null">
and n.pallet_name like concat('%',#{param.warehouse},'%')
</if>
<if test="paramMap.warehouseIds != null ">
and ldpl.warehouse_id IN
<foreach collection="paramMap.warehouseIds" item="wItem" index="index" open="(" close=")" separator=",">
#{wItem}
<if test="param.goodsAllocation !='' and param.goodsAllocation != null">
and m.qr_code like concat('%',#{param.warehouse},'%')
</if>
<if test="param.orderPackageGroundingStatus !='' and param.orderPackageGroundingStatus != null">
and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus}
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and ldpl.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="paramMap.tenantId != null and paramMap.tenantId != ''">
and ldpl.tenant_id = #{paramMap.tenantId}
<if test="param.orderPackageCode !='' and param.orderPackageCode != null">
and ldpl.order_package_code like concat(#{param.orderPackageCode},'%')
</if>
<if test="param.firsts !='' and param.firsts != null">
and ldpl.firsts = #{param.firsts}
</if>
<if test="param.second !='' and param.second != null">
and ldpl.second = #{param.second}
</if>
<if test="param.thirdProduct !='' and param.thirdProduct != null">
and ldpl.third_product = #{param.thirdProduct}
</if>
<if test="param.quantity !='' and param.quantity != null">
and ldpl.quantity = #{param.quantity}
</if>
<if test="param.trainNumber !='' and param.trainNumber != null">
and ldpl.train_number = #{param.trainNumber}
</if>
<if test="param.stockArticleId !='' and param.stockArticleId != null">
and ldpl.stock_article_id like concat('%',#{param.stockArticleId},'%')
</if>
<if test="param.orderCode !='' and param.orderCode != null">
and ldpl.order_code like concat(#{param.orderCode},'%')
</if>
<if test="param.serviceNumber !='' and param.serviceNumber != null">
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test="param.materialName !='' and param.materialName != null">
and ldpl.material_name like concat('%',#{param.materialName},'%')
</if>
<if test="param.materialCode !='' and param.materialCode != null">
and ldpl.material_code =#{param.materialCode}
</if>
<if test="param.brandName !='' and param.brandName != null">
and ldpl.brand_name like concat('%',#{param.brandName},'%')
</if>
<if test="param.orderPackageFreezeStatus !='' and param.orderPackageFreezeStatus != null">
and ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus}
</if>
<if test="param.orderPackageLoadingStatus !='' and param.orderPackageLoadingStatus != null">
and ldpl.order_package_loading_status = #{param.orderPackageLoadingStatus}
</if>
<if test="param.orderPackageReservationStatus !='' and param.orderPackageReservationStatus != null">
and ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus}
</if>
<if test="param.pallet !='' and param.pallet != null">
and lwtg.tray_code = #{param.pallet}
</if>
<if test="param.goodsAllocation !='' and param.goodsAllocation != null">
and lwug.position_code = #{param.goodsAllocation}
</if>
<if test="param.conditions !='' and param.conditions != null">
and ldpl.conditions = #{param.conditions}
</if>
<if test="param.orderPackageStatus !='' and param.orderPackageStatus != null">
and ldpl.order_package_status = #{param.orderPackageStatus}
</if>
<if test="param.waybillNumber != '' and param.waybillNumber != null ">
and ldpl.waybill_number = #{param.waybillNumber}
</if>
<if test="paramMap.serviceNumber != null and paramMap.serviceNumber != ''">
and ldpl.service_Number = #{paramMap.serviceNumber}
<if test="param.startWarehouseEntryTimeEnd != null and param.startWarehouseEntryTimeEnd !='' and param.lastWarehouseEntryTimeEnd !=''and param.lastWarehouseEntryTimeEnd != null">
and ldpl.warehouse_entry_time_end BETWEEN #{param.startWarehouseEntryTimeEnd} AND #{param.lastWarehouseEntryTimeEnd}
</if>
<if test="idArr != null and idArr != ''">
<if test="idArr != null ">
and ldpl.id in
<foreach collection="idArr" item="item" open="(" close=")" separator=",">
#{item}
@ -1507,5 +1689,37 @@
and warehouse_id = #{warehouseId}
</select>
<update id="updateFreezeStatusByWaybillIds" >
update logpm_distribution_parcel_list
set order_package_freeze_status = '20'
where waybill_id in
<foreach collection="waybillIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="updateUnFreezeStatusByWaybillIds" >
update logpm_distribution_parcel_list
set order_package_freeze_status = '10'
where waybill_id in
<foreach collection="waybillIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="clearParceListWaybillByAdvanceIds" >
update logpm_distribution_parcel_list
set waybill_id = null,
waybill_number = null,
send_warehouse_id = null,
send_warehouse_name = null,
accept_warehouse_id = null,
accept_warehouse_name = null,
is_transfer = 1
where advance_id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -223,4 +223,10 @@ public interface IDistributionParcelListService extends BaseService<Distribution
void updatePackageStatus(List<String> orderPackageCodes, Long warehouseId, String packageStatus);
List<DistributionParcelListEntity> findListByOrderPackageCode(List<String> orderPackageCodes, Long warehouseId);
void updateFreezeStatusByWaybillIds(List<Long> waybillIds);
void updateUnFreezeStatusByWaybillIds(List<Long> waybillIds);
void clearParceListWaybillByAdvanceIds(List<Long> advanceIds);
}

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -1235,4 +1235,19 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.findListByOrderPackageCode(orderPackageCodes,warehouseId);
}
@Override
public void updateFreezeStatusByWaybillIds(List<Long> waybillIds) {
baseMapper.updateFreezeStatusByWaybillIds(waybillIds);
}
@Override
public void updateUnFreezeStatusByWaybillIds(List<Long> waybillIds) {
baseMapper.updateUnFreezeStatusByWaybillIds(waybillIds);
}
@Override
public void clearParceListWaybillByAdvanceIds(List<Long> advanceIds) {
baseMapper.clearParceListWaybillByAdvanceIds(advanceIds);
}
}

23
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java

@ -492,7 +492,7 @@ public class BillladingController {
}
@ResponseBody
@PostMapping("/findDriverListByName")
@PostMapping("/findDriverListByName")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "通过名称查司机", notes = "传入waybillDTO")
public R findDriverListByName(@RequestBody BillladingDTO billladingDTO) {
@ -551,6 +551,27 @@ public class BillladingController {
}
@ResponseBody
@PostMapping("/findBillladingLogList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询提货单日志", notes = "传入waybillDTO")
public R findBillladingLogList(@RequestBody BillladingDTO billladingDTO) {
String method = "############findBillladingLogList: ";
log.info(method + "请求参数{}", billladingDTO);
Long billladingId = billladingDTO.getBillladingId();
try{
return trunklineBillladingService.findBillladingLogList(billladingId);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

120
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -1,7 +1,6 @@
package com.logpm.trunkline.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -11,6 +10,7 @@ import com.logpm.trunkline.dto.OpenLabelDTO;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillDetailDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IOpenOrderService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
@ -40,6 +40,7 @@ public class OpenOrderController {
private final IBasicdataWarehouseClient warehouseClient;
private final IOpenOrderService openOrderService;
private final ITrunklineCarsLoadService carsLoadService;
private final ICarsLoadAsyncService carsLoadAsyncService;
@ResponseBody
@PostMapping("/advancePageList")
@ -1089,9 +1090,7 @@ public class OpenOrderController {
R<List<TrunklineAdvanceEntity>> listR = openOrderService.openLabelHasPacakage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file);
List<TrunklineAdvanceEntity> data = listR.getData();
if(!CollUtil.isEmpty(data)){
for (TrunklineAdvanceEntity datum : data) {
carsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(datum));
}
carsLoadAsyncService.sendRabbitMessageLoadScanData(data);
}
return listR;
@ -1160,9 +1159,7 @@ public class OpenOrderController {
R<List<TrunklineAdvanceEntity>> listR = openOrderService.importCustomizedOuPai(myCurrentWarehouse.getId(), myCurrentWarehouse.getName(), file);
List<TrunklineAdvanceEntity> data = listR.getData();
if(!CollUtil.isEmpty(data)){
for (TrunklineAdvanceEntity datum : data) {
carsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(datum));
}
carsLoadAsyncService.sendRabbitMessageLoadScanData(data);
}
return listR;
}catch (CustomerException e){
@ -1194,9 +1191,7 @@ public class OpenOrderController {
R<List<TrunklineAdvanceEntity>> listR = openOrderService.importStandardOuPai(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file);
List<TrunklineAdvanceEntity> data = listR.getData();
if(!CollUtil.isEmpty(data)){
for (TrunklineAdvanceEntity datum : data) {
carsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(datum));
}
carsLoadAsyncService.sendRabbitMessageLoadScanData(data);
}
return listR;
}catch (CustomerException e){
@ -1217,7 +1212,7 @@ public class OpenOrderController {
String method = "############findWaybillDetail: ";
log.info(method + "请求参数{}", openOrderDTO);
Long waybillId = openOrderDTO.getWaybillId();
Integer isEdit = openOrderDTO.getIsEdit();
try{
//当前登录人选择的仓库
@ -1234,6 +1229,11 @@ public class OpenOrderController {
return R.fail(403,"运单号id为空");
}
if (Objects.isNull(isEdit)){
log.warn(method+"查看类型为空 isEdit={}",isEdit);
return R.fail(403,"查看类型为空");
}
return openOrderService.findWaybillDetail(openOrderDTO);
}catch (CustomerException e){
log.error(e.message,e);
@ -1285,7 +1285,7 @@ public class OpenOrderController {
@PostMapping("/updateWaybill")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "改单", notes = "传入openOrderDTO")
public R updateWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
public R updateWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############updateWaybill: ";
log.info(method + "请求参数{}", openOrderDTO);
Long waybillId = openOrderDTO.getWaybillId();
@ -1613,4 +1613,100 @@ public class OpenOrderController {
}
}
@ResponseBody
@PostMapping("/freezeWaybill")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "冻结运单", notes = "传入openOrderDTO")
public R freezeWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############freezeWaybill: ";
log.info(method + "请求参数{}", openOrderDTO);
List<Long> waybillIds = openOrderDTO.getWaybillIds();
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"请选择仓库 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"请选择仓库");
}
if(CollUtil.isEmpty(waybillIds)){
log.warn(method+"运单ids为空 waybillIds={}",waybillIds);
return R.fail(405,"运单ids为空");
}
return openOrderService.freezeWaybill(waybillIds,myCurrentWarehouse.getId(),myCurrentWarehouse.getName());
}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,"系统异常");
}
}
@ResponseBody
@PostMapping("/unFreezeWaybill")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "解冻运单", notes = "传入openOrderDTO")
public R unFreezeWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############unFreezeWaybill: ";
log.info(method + "请求参数{}", openOrderDTO);
List<Long> waybillIds = openOrderDTO.getWaybillIds();
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"请选择仓库 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"请选择仓库");
}
if(CollUtil.isEmpty(waybillIds)){
log.warn(method+"运单ids为空 waybillIds={}",waybillIds);
return R.fail(405,"运单ids为空");
}
return openOrderService.unFreezeWaybill(waybillIds,myCurrentWarehouse.getId(),myCurrentWarehouse.getName());
}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,"系统异常");
}
}
@ResponseBody
@PostMapping("/abolishWaybill")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "作废运单", notes = "传入openOrderDTO")
public R abolishWaybill(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############abolishWaybill: ";
log.info(method + "请求参数{}", openOrderDTO);
List<Long> waybillIds = openOrderDTO.getWaybillIds();
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"请选择仓库 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"请选择仓库");
}
if(CollUtil.isEmpty(waybillIds)){
log.warn(method+"运单ids为空 waybillIds={}",waybillIds);
return R.fail(405,"运单ids为空");
}
return openOrderService.abolishWaybill(waybillIds,myCurrentWarehouse.getId(),myCurrentWarehouse.getName());
}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,"系统异常");
}
}
}

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

@ -59,4 +59,5 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
IPage<OrderDetailInfoVO> findOrderDetails(IPage<Object> page, @Param("param") OrderDetailsDTO orderDetailsDTO);
void updateWaybillNoIsNullByAdvanceIds(@Param("advanceIds") List<Long> advanceIds);
}

14
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -260,7 +260,7 @@
and LOCATE(#{param.orderCode}, pl.order_code) > 0
</if>
<if test="param.waybillNo != null and param.waybillNo != '' ">
and ad.waybill_no = #{param.waybill}
and ad.waybill_no = #{param.waybillNo}
</if>
<if test="param.trainNumber != null and param.trainNumber != '' ">
and ad.train_number = #{param.trainNumber}
@ -289,7 +289,7 @@
and LOCATE(#{param.orderCode}, ltad.order_code) > 0
</if>
<if test="param.waybillNo != null and param.waybillNo != '' ">
and ltad.waybill_no = #{param.waybill}
and ltad.waybill_no = #{param.waybillNo}
</if>
<if test="param.trainNumber != null and param.trainNumber != '' ">
and ltad.train_number = #{param.trainNumber}
@ -336,4 +336,14 @@
</select>
<update id="updateWaybillNoIsNullByAdvanceIds" >
update logpm_trunkline_advance_detail
set waybill_no = null,
waybill_id = null
where advance_id in
<foreach collection="advanceIds" item="advanceId" open="(" separator="," close=")">
#{advanceId}
</foreach>
</update>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.BillladingDTO;
import com.logpm.trunkline.entity.TrunklineBillladingEntity;
import com.logpm.trunkline.entity.TrunklineBillladingLogEntity;
import com.logpm.trunkline.vo.TrunklineBillladingDetailListVO;
import com.logpm.trunkline.vo.TrunklineBillladingDetailVO;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
@ -29,4 +30,6 @@ public interface TrunklineBillladingMapper extends BaseMapper<TrunklineBillladin
List<TrunklineBillladingDetailListVO> findAdvanceDetailList(@Param("orderCode") String orderCode);
Map<String, Integer> billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr);
List<TrunklineBillladingLogEntity> findBillladingLogList(@Param("billladingId") Long billladingId);
}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml

@ -177,4 +177,15 @@
</select>
<select id="findBillladingLogList" resultType="com.logpm.trunkline.entity.TrunklineBillladingLogEntity">
select warehouse_id warehouseId,
warehouse_name warehouseName,
create_user_name createUserName,
content content,
create_time createTime
from logpm_trunkline_billlading_log
where billlading_id = #{billladingId}
order by create_time asc
</select>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -202,9 +202,12 @@
ltwo.order_code,
sum(ltwo.total_number) total_number
from logpm_trunkline_waybill_order ltwo
where ltwo.is_deleted = 0
group by ltwo.waybill_no,
ltwo.order_code) m on m.order_code = t.order_code and m.waybill_no = t.waybill_number
where IFNULL( t.stock_num, 0 )-IFNULL( l.planNum,0) > 0
and lww.abolish_status = 0
and lww.freeze_status = 0
<if test="param.openTimeStart != null">
and lww.create_time &gt;= #{param.openTimeStart}
</if>

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

@ -12,6 +12,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -90,7 +91,7 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<LoadingListGoodsVO> findUnloadGoods(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo);
void updateScanStatus(@Param("loadScanIds") List<Long> loadScanIds, @Param("scanStatus") String scanStatus);
void updateScanStatusAndTime(@Param("loadScanIds") List<Long> loadScanIds, @Param("scanStatus") String scanStatus, @Param("unloadTime") Date unloadTime);
List<LoadScanWaybillVO> findLoadScanWaybillList(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId);
@ -116,7 +117,7 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<String> findUnloadByLoadIdAndWarehouseId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
void updateScanStatusByLoadId(@Param("loadId") Long loadId, @Param("scanStatus") String scanStatus);
void updateScanStatusByLoadId(@Param("loadId") Long loadId, @Param("scanStatus") String scanStatus, @Param("unloadTime") Date unloadTime);
List<String> findSignListOrderPackageCodes(@Param("loadId") Long loadId);
@ -147,4 +148,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<String> findIncomingOrdeCodesByCarsLoadScanIds(@Param("carsLoadScanIds") List<Long> carsLoadScanIds, @Param("warehouseId") Long warehouseId);
List<TrunklineCarsLoadScanVO> findListHasSignOrderIdByIds(@Param("carsLoadScanIds") List<Long> loadScanIds);
List<Long> findCarsLoadScanIdsByWaybillIds(@Param("waybillIds") List<Long> waybillIds);
}

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

@ -83,6 +83,58 @@
select *
from logpm_trunkline_cars_load_scan
where load_id = #{param.loadId}
<if test="param.waybillNo != null and param.waybillNo != ''">
and Locate(#{param.waybillNo},waybill_no) > 0
</if>
<if test="param.orderCode != null and param.orderCode != ''">
and Locate(#{param.orderCode},order_code) > 0
</if>
<if test="param.scanCode != null and param.scanCode != ''">
and Locate(#{param.scanCode},scan_code) > 0
</if>
<if test="param.loadingUserName != null and param.loadingUserName != ''">
and Locate(#{param.loadingUserName},loading_user_name) > 0
</if>
<if test="param.warehouseName != null and param.warehouseName != ''">
and Locate(#{param.warehouseName},warehouse_name) > 0
</if>
<if test="param.finalNodeName != null and param.finalNodeName != ''">
and Locate(#{param.finalNodeName},final_node_name) > 0
</if>
<if test="param.finalNodeName != null and param.finalNodeName != ''">
and Locate(#{param.finalNodeName},final_node_name) > 0
</if>
<if test="param.scanStatus != null">
and scan_status = #{param.scanStatus}
</if>
<if test="param.trayName != null and param.trayName != ''">
and Locate(#{param.trayName},tray_name) > 0
</if>
<if test="param.trayCode != null and param.trayCode != ''">
and Locate(#{param.trayCode},tray_code) > 0
</if>
<if test="param.unloadNodeName != null and param.unloadNodeName != ''">
and Locate(#{param.unloadNodeName},unload_node_name) > 0
</if>
<if test="param.unloadUserName != null and param.unloadUserName != ''">
and Locate(#{param.unloadUserName},unload_user_name) > 0
</if>
<if test="param.type != null">
and `type` = #{param.type}
</if>
<if test="param.isData != null">
and is_data = #{param.isData}
</if>
<if test="param.loadingAbnormal != null">
and loading_abnormal = #{param.loadingAbnormal}
</if>
<if test="param.unloadAbnormal != null">
and unload_abnormal = #{param.unloadAbnormal}
</if>
<if test="param.isSupple != null">
and is_supple = #{param.isSupple}
</if>
</select>
@ -400,9 +452,10 @@
ltco.unload_num
</select>
<update id="updateScanStatus">
<update id="updateScanStatusAndTime">
update logpm_trunkline_cars_load_scan
set scan_status = #{scanStatus}
set scan_status = #{scanStatus},
sign_time = #{unloadTime}
where 1=1
<if test="loadScanIds != null and loadScanIds.size() > 0">
and id in
@ -513,7 +566,8 @@
<update id="updateScanStatusByLoadId" >
update logpm_trunkline_cars_load_scan
set scan_status = #{scanStatus}
set scan_status = #{scanStatus},
sign_time = #{unloadTime}
where load_id = #{loadId}
</update>
@ -714,4 +768,15 @@
</foreach>
</select>
<select id="findCarsLoadScanIdsByWaybillIds" resultType="Long">
select ltcls.id
from logpm_trunkline_cars_load_scan ltcls
where ltcls.waybill_id in
<foreach collection="waybillIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and ltcls.scan_status = '1'
group by ltcls.id
</select>
</mapper>

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

@ -135,9 +135,9 @@
select ltco.order_code orderCode,
IFNULL(ltco.plan_num,0) planNum,
t.loadingNum,
lww.total_freight orderFreight,
lww.check_user_name checkUserName,
IFNULL(ltco.unload_num,0) unloadNum,
IFNULL(lww.total_freight/lww.total_count*ltwo.total_number,0) orderFreight,
IFNULL(lww.total_freight/lww.total_count*t.unloadNum,0) unloadIncome,
m.costPiece,
m.costZhang,
@ -159,7 +159,7 @@
group by ltcsr.waybill_no,
ltcsr.order_code) m on m.waybillNo = t.waybillNo and m.orderCode = t.orderCode
left join logpm_trunkline_cars_order ltco on ltco.waybill_no = t.waybillNo and ltco.order_code = t.orderCode
left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no
left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no and ltwo.is_deleted = 0
left join logpm_warehouse_waybill lww on lww.waybill_no = ltwo.waybill_no
where ltco.load_id = #{loadId}
and ltco.waybill_no = #{waybillNo}
@ -171,14 +171,14 @@
select ltco.order_code orderCode,
ltco.plan_num planNum,
ltco.real_num loadingNum,
lww.total_freight orderFreight,
lww.check_user_name checkUserName,
IFNULL(ltco.unload_num,0) unloadNum,
IFNULL(lww.total_freight/lww.total_count*ltwo.total_number,0) orderFreight,
IFNULL(lww.total_freight/lww.total_count*ltco.unload_num,0) unloadIncome,
IFNULL(lww.total_freight/lww.total_count*ltco.plan_num,0) orderLineCost,
sum(ltwo.total_number) orderNum
from logpm_trunkline_cars_order ltco
left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no
left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no and ltwo.is_deleted = 0
left join logpm_warehouse_waybill lww on lww.waybill_no = ltwo.waybill_no
where ltco.load_id = #{loadId}
and ltco.waybill_no = #{waybillNo}

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

@ -20,4 +20,6 @@ public interface TrunklineWaybillOrderMapper extends BaseMapper<TrunklineWaybill
Long findWaybillIdByAdvanceId(@Param("advanceId") Long advanceId);
Integer findTotalNumByWaybillNoAndOrderCode(@Param("waybillId") Long waybillId, @Param("orderCode") String orderCode);
List<Long> findAdvanceIdsByWaybillIds(@Param("waybillIds") List<Long> waybillIds);
}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineWaybillOrderMapper.xml

@ -36,4 +36,15 @@
and ltwo.order_code = #{orderCode}
</select>
<select id="findAdvanceIdsByWaybillIds" resultType="Long">
select ltwo.advance_id
from logpm_trunkline_waybill_order ltwo
where ltwo.waybill_id in
<foreach collection="waybillIds" item="waybillId" open="(" separator="," close=")">
#{waybillId}
</foreach>
and ltwo.is_deleted = 0
group by ltwo.advance_id
</select>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity;
@ -23,4 +24,6 @@ public interface ICarsLoadAsyncService {
void dealwithAfterAbnormalPackage(String orderPackageCode, Long warehouseId, String warehouseName, String carsNo, Long userId, Long aLong, String nickName);
void savaUnloadLogBatch(List<TrunklineCarsUnloadLogEntity> unloadLogList);
void sendRabbitMessageLoadScanData(List<TrunklineAdvanceEntity> data);
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java

@ -82,6 +82,11 @@ public interface IOpenOrderService {
R findUpdateWaybillList(OpenOrderDTO openOrderDTO);
R freezeWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName);
R unFreezeWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName);
R abolishWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName);
// R findWaybillInfo(String waybillNo);

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -73,4 +73,5 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
R findOrderDetails(OrderDetailsDTO orderDetailsDTO);
void updateWaybillNoIsNullByAdvanceIds(List<Long> advanceIds);
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java

@ -44,4 +44,7 @@ public interface ITrunklineBillladingService extends BaseService<TrunklineBillla
R billladingList(BillladingDTO billladingDTO);
List<TrunklineBillladingDetailListVO> findAdvanceDetailList(BillladingDTO billladingDTO);
R findBillladingLogList(Long billladingId);
}

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

@ -10,6 +10,7 @@ import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -85,7 +86,7 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<LoadingListGoodsVO> findUnloadGoods(Long loadId, Long warehouseId, String orderCode, String waybillNo);
void updateScanStatus(List<Long> loadScanIds, String scanStatus);
void updateScanStatusAndTime(List<Long> loadScanIds, String scanStatus,Date unloadTime);
List<LoadScanWaybillVO> findLoadScanWaybillList(Long loadId, Long nodeId);
@ -111,7 +112,7 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<String> findUnloadByLoadIdAndWarehouseId(Long loadId, Long warehouseId);
void updateScanStatusByLoadId(Long loadId, String scanStatus);
void updateScanStatusByLoadId(Long loadId, String scanStatus, Date unloadTime);
List<String> findSignListOrderPackageCodes(Long loadId);
@ -142,4 +143,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<String> findIncomingOrdeCodesByCarsLoadScanIds(List<Long> carsLoadScanIds, Long warehouseId);
List<TrunklineCarsLoadScanVO> findListHasSignOrderIdByIds(List<Long> loadScanIds);
List<Long> findCarsLoadScanIdsByWaybillIds(List<Long> waybillIds);
}

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

@ -19,4 +19,6 @@ public interface ITrunklineWaybillOrderService extends BaseService<TrunklineWayb
Integer findTotalNumByWaybillNoAndOrderCode(Long waybillId, String orderCode);
List<Long> findAdvanceIdsByWaybillIds(List<Long> waybillIds);
}

31
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -1,5 +1,7 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
import com.logpm.aftersales.feign.IAftersalesAbnormalRecordClient;
import com.logpm.aftersales.feign.IAftersalesWorkOrderClient;
@ -14,11 +16,14 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
@ -26,9 +31,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
@Slf4j
@Service
@ -55,6 +58,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
private IAftersalesWorkOrderClient aftersalesWorkOrderClient;
@Autowired
private ITrunklineCarsUnloadLogService trunklineCarsUnloadLogService;
@Autowired
private RabbitTemplate rabbitTemplate;
@Async("asyncExecutor")
@Override
@ -518,4 +523,24 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
trunklineCarsUnloadLogService.savaUnloadLogBatch(unloadLogList);
}
@Async("asyncExecutor")
@Override
public void sendRabbitMessageLoadScanData(List<TrunklineAdvanceEntity> data) {
String queue = RabbitConstant.INCOMING_TO_LOAD_QUEUE;
String exchange = RabbitConstant.INCOMING_TO_LOAD_EXCHANGE;
String routing = RabbitConstant.INCOMING_TO_LOAD_ROUTING;
String msgId = IdUtil.simpleUUID();
for (TrunklineAdvanceEntity datum : data) {
Map<String, Object> map = new HashMap<>();
map.put("messageId", CommonUtil.getUUID());
map.put("logId", msgId);
map.put("messageData", JSONUtil.toJsonStr(datum));
map.put("createTime", new Date().getTime());
map.put("flagType", "OrderStatusLog");
//将消息携带绑定键值
rabbitTemplate.convertAndSend(exchange, routing, map, new CorrelationData(msgId));
}
}
}

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

@ -136,14 +136,16 @@ public class InComingServiceImpl implements IInComingService {
Integer incomingType = inComingDTO.getIncomingType();
if(incomingType == 5){
String incomingCode = inComingDTO.getIncomingCode();
incomingCode = incomingCode.replaceAll(",",",");
List<String> orderCodes = new ArrayList<>();
if(incomingCode.contains(",")){
orderCodes.addAll(Arrays.asList(incomingCode.split(",")));
}else{
orderCodes.add(incomingCode);
if(!StringUtil.isBlank(incomingCode)){
incomingCode = incomingCode.replaceAll(",",",");
List<String> orderCodes = new ArrayList<>();
if(incomingCode.contains(",")){
orderCodes.addAll(Arrays.asList(incomingCode.split(",")));
}else{
orderCodes.add(incomingCode);
}
inComingDTO.setOrderCodes(orderCodes);
}
inComingDTO.setOrderCodes(orderCodes);
}
List<TrunklineAdvanceVO> ls = advanceService.findIncomingOrderList(inComingDTO);

299
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
@ -89,6 +90,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
private final ITrunklineWaybillReturnService trunklineWaybillReturnService;
private final IBasicdataOpenIncomingClient basicdataOpenIncomingClient;
private final ITrunklineCarsLoadService carsLoadService;
private final ITrunklineCarsLoadScanService trunklineCarsLoadScanService;
private final IBasicdataStoreContactClient basicdataStoreContactClient;
private final IAsyncService asyncService;
@ -383,6 +385,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setTotalWeight(openOrderDTO.getTotalWeghit());
waybillEntity.setDealerCode(openOrderDTO.getDealerCode());
waybillEntity.setDealerName(openOrderDTO.getDealerName());
waybillEntity.setWaybillStatus("0");
//统计当前订单的在库数
List<Long> advanceIds = openOrderDTO.getAdvanceIds();
AdvanceDetailStockNumVO advanceDetailStockNumVO = advanceDetailService.findStockNumByAdvanceIds(advanceIds);
@ -420,13 +423,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setReceipt(openOrderDTO.getReceipt());
waybillEntity.setRemark(openOrderDTO.getRemark());
waybillEntity.setWaybillType(openOrderDTO.getWaybillType());
waybillEntity.setAgent(AuthUtil.getUserName());
waybillEntity.setAgent(AuthUtil.getNickName());
waybillEntity.setAgentId(AuthUtil.getUserId());
waybillEntity.setDocumentMakingTime(CommonUtil.StringToDate(openOrderDTO.getOpenOrderDate()));
waybillEntity.setPickupCompleteOrNot(openOrderDTO.getPickupCompleteOrNot());
waybillEntity.setTrunklineCompleteOrNot(openOrderDTO.getTrunklineCompleteOrNot());
waybillEntity.setTrunklineVehicleType(openOrderDTO.getTrunklineVehicleType());
waybillEntity.setPickupVehicleType(openOrderDTO.getPickupVehicleType());
waybillEntity.setAbolishStatus(0);
waybillEntity.setFreezeStatus(0);
Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity);
if (!Objects.isNull(waybillId)) {
@ -567,6 +572,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Boolean aBoolean = basicdataOpenIncomingClient.checkOpenIncoming(warehouseId, brandId);
if (Boolean.TRUE.equals(aBoolean)) {
openOrderAsyncService.incomingPackageBatch(advanceIds, AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getTenantId(), AuthUtil.getNickName(), IncomingTypeEnum.OPEN_TO_IN.getCode(),warehouseId,warehouseName);
waybillEntity.setStockCount(waybillEntity.getTotalCount());
waybillEntity.setWaybillStatus("20");
warehouseWaybillClient.updateEntity(waybillEntity);
}
//异步存入日志
@ -700,8 +708,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setRemark(openOrderDTO.getRemark());
waybillEntity.setWaybillType(openOrderDTO.getWaybillType());
waybillEntity.setWaybillStatus("20");
waybillEntity.setAgent(AuthUtil.getUserName());
waybillEntity.setAgent(AuthUtil.getNickName());
waybillEntity.setAgentId(AuthUtil.getUserId());
waybillEntity.setAbolishStatus(0);
waybillEntity.setFreezeStatus(0);
Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity);
waybillEntity.setId(waybillId);
@ -948,7 +958,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setOrderCode(openLabelDTO.getOrderCode());
advanceEntity.setSiteName(openLabelDTO.getSiteName());
advanceEntity.setArea(openLabelDTO.getArea());
advanceEntity.setOrderType("Label");
// advanceEntity.setOrderType("Label");
advanceEntity.setBrand(openLabelDTO.getBrand());
Integer totalNumber = openLabelDTO.getTotalNumber();
advanceEntity.setTotalNum(totalNumber);
@ -1043,7 +1053,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<Long> advanceIds = new ArrayList<>();
List<TrunklineAdvanceEntity> detailEntities = advanceService.findListByExistsAndOrderCodeSet(orderCodeSet);
List<TrunklineAdvanceEntity> detailEntities = new ArrayList<>();
//把orderCodeSet分成每2000个元素为一组
List<Set<String>> orderCodeSets = orderCodeSet.parallelStream().collect(Collectors.groupingBy(a -> a.hashCode() % 2000)).values().stream().map(a -> new HashSet<>(a)).collect(Collectors.toList());
for (int i = 0; i < orderCodeSets.size(); i++) {
Set<String> set1 = orderCodeSets.get(i);
List<TrunklineAdvanceEntity> entities = advanceService.findListByExistsAndOrderCodeSet(orderCodeSet);
detailEntities.addAll(entities);
}
//把detailEntities转化成以orderCode和trainNumber为key的map
detailEntities.forEach(advanceEntity -> {
String orderCode = advanceEntity.getOrderCode();
@ -1053,7 +1071,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
});
Map<String, List<TrunklineAdvanceEntity>> advanceMap = detailEntities.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber()));
// Map<String, List<TrunklineAdvanceEntity>> advanceMap = detailEntities.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber()));
listMap.keySet().forEach(str -> {
String[] split = str.split("&");
@ -1071,12 +1089,24 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setWarehouseName(warehouseName);
advanceEntity.setOrderCode(orderCode);
advanceEntity.setArea(pacakgeDetailExcelDTO.getArea());
advanceEntity.setBrand(pacakgeDetailExcelDTO.getBrand());
String brand = pacakgeDetailExcelDTO.getBrand();
advanceEntity.setBrand(brand);
advanceEntity.setTotalNum(excelDTOS.size());
String firsts = pacakgeDetailExcelDTO.getFirsts();
advanceEntity.setPackName(firsts);
advanceEntity.setDealerCode(pacakgeDetailExcelDTO.getDealerCode());
advanceEntity.setDealerName(pacakgeDetailExcelDTO.getDealerName());
String dealerName = pacakgeDetailExcelDTO.getDealerName();
if(StringUtil.isBlank(dealerName)){
if(StringUtil.equals(brand,"欧派")){
//获取orderCode数字第一次出现的前面字符串截取
int firstDigitIndex = findFirstDigitIndex(orderCode);
if(firstDigitIndex != -1){
dealerName = orderCode.substring(0,firstDigitIndex);
}
}
}
advanceEntity.setDealerName(dealerName);
advanceEntity.setConsigneePerson(pacakgeDetailExcelDTO.getConsigneePerson());
advanceEntity.setConsigneeMobile(pacakgeDetailExcelDTO.getConsigneeMobile());
advanceEntity.setConsigneeAddress(pacakgeDetailExcelDTO.getConsigneeAddress());
@ -1231,6 +1261,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
return R.data(advanceEntityList);
}
public int findFirstDigitIndex(String str) {
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (Character.isDigit(c)) {
return i;
}
}
return -1; // 如果没有找到数字,返回-1
}
@Transactional(rollbackFor = Exception.class)
@Override
public R<List<TrunklineAdvanceEntity>> importCustomizedOuPai(Long warehouseId, String warehouseName, MultipartFile file) throws IOException {
@ -1513,8 +1553,21 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
@Override
public R findWaybillDetail(OpenOrderDTO openOrderDTO) {
Long waybillId = openOrderDTO.getWaybillId();
Integer isEdit = openOrderDTO.getIsEdit();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
if(Objects.isNull(waybillEntity)){
log.warn("#############findWaybillDetail: 运单信息不存在 waybillId={}",waybillId);
return R.fail(405,"运单信息不存在");
}
if(isEdit.equals(1)){
Integer abolishStatus = waybillEntity.getAbolishStatus();
if(abolishStatus.equals(1)){
log.warn("#############findWaybillDetail: 运单已作废 waybillId={}",waybillId);
return R.fail(405,"运单已作废");
}
}
WarehouseWaybillVO warehouseWaybillVO = new WarehouseWaybillVO();
BeanUtil.copy(waybillEntity, warehouseWaybillVO);
@ -1550,6 +1603,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
log.warn("#############updateWaybill: 运单信息不存在 waybillId={}", waybillId);
return R.fail(405, "运单信息不存在");
}
Integer abolishStatus = waybillEntity.getAbolishStatus();
if(abolishStatus.equals(1)){
log.warn("#############updateWaybill: 运单已作废 waybillId={}", waybillId);
return R.fail(405, "运单已作废");
}
String updateMsg = verifyUpdateData(openOrderDTO, waybillEntity);
warehouseWaybillClient.updateEntity(waybillEntity);
@ -1569,6 +1629,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
log.warn("#############updateWaybill: 运单信息不存在 waybillId={}", waybillId);
return R.fail(405, "运单信息不存在");
}
Integer abolishStatus = waybillEntity.getAbolishStatus();
if(abolishStatus.equals(1)){
log.warn("#############updateWaybill: 运单已作废 waybillId={}", waybillId);
return R.fail(405, "运单已作废");
}
// String updateMsg = verifyData(openOrderDTO,waybillEntity);
List<EditOrderMsgVO> list = verifyData(openOrderDTO,waybillEntity);
@ -1750,6 +1817,17 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
log.warn("##############checkWaybill: 运单信息不存在");
return R.fail(405, "运单信息不存在");
}
Integer abolishStatus = warehouseWaybillEntity.getAbolishStatus();
if(abolishStatus.equals(1)){
log.warn("#############checkWaybill: 运单已作废 waybillId={}",waybillId);
return R.fail(405,"运单已作废");
}
Long checkUserId = warehouseWaybillEntity.getCheckUserId();
if(!Objects.isNull(checkUserId)){
log.warn("##############checkWaybill: 运单已经审核 waybillId={}",waybillId);
return R.fail(405, "运单已经审核");
}
warehouseWaybillEntity.setCheckUserId(AuthUtil.getUserId());
warehouseWaybillEntity.setCheckUserName(AuthUtil.getNickName());
@ -2252,6 +2330,135 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
return R.data(pageList);
}
@Override
public R freezeWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName) {
List<WarehouseWaybillEntity> waybillEntities = warehouseWaybillClient.findListByWaybillIds(waybillIds);
waybillEntities.forEach(waybillEntity -> {
String waybillNo = waybillEntity.getWaybillNo();
Integer abolishStatus = waybillEntity.getAbolishStatus();
Integer freezeStatus = waybillEntity.getFreezeStatus();
if(abolishStatus.equals(1)){
log.warn("##############freezeWaybill: {}运单已经作废",waybillNo);
throw new CustomerException(405,waybillNo+"运单已经作废,不能冻结");
}
if(freezeStatus.equals(1)){
log.warn("##############freezeWaybill: {}运单已冻结",waybillNo);
throw new CustomerException(405,waybillNo+"运单已冻结,不能冻结");
}
waybillEntity.setFreezeStatus(1);
waybillEntity.setFreezeTime(new Date());
waybillEntity.setFreezeUserName(AuthUtil.getNickName());
});
warehouseWaybillClient.updateList(waybillEntities);
//修改所有该运单的包件状态为已冻结
distributionParcelListClient.updateFreezeStatusByWaybillIds(waybillIds);
waybillEntities.forEach(waybillEntity -> {
String createOperationRemark = "冻结运单" + waybillEntity.getWaybillNo() + ",时间:" + CommonUtil.dateToString(new Date());
openOrderAsyncService.saveLog(waybillEntity.getId(), waybillEntity.getWaybillNo(), "990", "冻结运单", createOperationRemark, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName);
});
return R.success("修改成功");
}
@Override
public R unFreezeWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName) {
List<WarehouseWaybillEntity> waybillEntities = warehouseWaybillClient.findListByWaybillIds(waybillIds);
waybillEntities.forEach(waybillEntity -> {
String waybillNo = waybillEntity.getWaybillNo();
Integer abolishStatus = waybillEntity.getAbolishStatus();
Integer freezeStatus = waybillEntity.getFreezeStatus();
if(abolishStatus.equals(1)){
log.warn("##############unFreezeWaybill: {}运单已经作废",waybillNo);
throw new CustomerException(405,waybillNo+"运单已经作废,不能解冻");
}
if(freezeStatus.equals(0)){
log.warn("##############unFreezeWaybill: {}运单未冻结",waybillNo);
throw new CustomerException(405,waybillNo+"运单未冻结,不能解冻");
}
waybillEntity.setFreezeStatus(0);
waybillEntity.setFreezeTime(null);
waybillEntity.setFreezeUserName(null);
});
warehouseWaybillClient.updateWaybillFreezeStatusByWaybillIds(waybillIds);
//修改所有该运单的包件状态为已冻结
distributionParcelListClient.updateUnFreezeStatusByWaybillIds(waybillIds);
waybillEntities.forEach(waybillEntity -> {
String createOperationRemark = "解冻运单" + waybillEntity.getWaybillNo() + ",时间:" + CommonUtil.dateToString(new Date());
openOrderAsyncService.saveLog(waybillEntity.getId(), waybillEntity.getWaybillNo(), "991", "解冻运单", createOperationRemark, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName);
});
return R.success("修改成功");
}
@Transactional(rollbackFor = Exception.class)
@Override
public R abolishWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName) {
List<WarehouseWaybillEntity> waybillList = warehouseWaybillClient.findListByWaybillIds(waybillIds);
List<WarehouseWaybillEntity> waybillEntities = warehouseWaybillClient.findListByWaybillIds(waybillIds);
waybillList.forEach(waybillEntity -> {
String waybillNo = waybillEntity.getWaybillNo();
String waybillStatus = waybillEntity.getWaybillStatus();
if(StringUtil.isBlank(waybillStatus)){
log.warn("##############abolishWaybill: {}运单为旧数据不能作废",waybillNo);
throw new CustomerException(405,waybillNo+"运单为旧数据不能作废");
}
Integer waybillStatusNum = Integer.parseInt(waybillStatus);
if(waybillStatusNum >= 30){
log.warn("##############abolishWaybill: {}运单已经进入配载不能进行作废",waybillNo);
throw new CustomerException(405,waybillNo+"运单已经进入配载不能进行作废");
}
Integer abolishStatus = waybillEntity.getAbolishStatus();
if(abolishStatus.equals(1)){
log.warn("##############abolishWaybill: {}运单已经作废",waybillNo);
throw new CustomerException(405,waybillNo+"运单已经作废,不能重复作废");
}
waybillEntity.setAbolishStatus(1);
waybillEntity.setAbolishUserName(AuthUtil.getNickName());
waybillEntity.setAbolishTime(new Date());
});
warehouseWaybillClient.updateList(waybillEntities);
//把装了车的包件取消装车
List<Long> carsLoadScanIds = trunklineCarsLoadScanService.findCarsLoadScanIdsByWaybillIds(waybillIds);
if(!CollUtil.isEmpty(carsLoadScanIds)){
//把carsLoadScanIds中的元素用,拼接起来成为一个字符串
String carsLoadScanIdsStr = CollUtil.join(carsLoadScanIds, ",");
carsLoadService.removeCarsLoadScan(carsLoadScanIdsStr,warehouseId);
}
List<Long> advanceIds = trunklineWaybillOrderService.findAdvanceIdsByWaybillIds(waybillIds);
trunklineWaybillOrderService.remove(new QueryWrapper<TrunklineWaybillOrderEntity>().in("waybill_id",waybillIds));
if(!advanceIds.isEmpty()){
List<TrunklineAdvanceEntity> advanceEntities = advanceService.findListByIds(advanceIds);
advanceEntities.forEach(advanceEntity -> {
advanceEntity.setWaybillStatus("0");
advanceEntity.setWaybillNo(null);
});
advanceService.updateBatchById(advanceEntities);
advanceDetailService.updateWaybillNoIsNullByAdvanceIds(advanceIds);
distributionParcelListClient.clearParceListWaybillByAdvanceIds(advanceIds);
}
waybillEntities.forEach(waybillEntity -> {
String createOperationRemark = "作废运单" + waybillEntity.getWaybillNo() + ",时间:" + CommonUtil.dateToString(new Date());
openOrderAsyncService.saveLog(waybillEntity.getId(), waybillEntity.getWaybillNo(), "1000", "作废运单", createOperationRemark, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName);
});
return R.success("作废成功");
}
private List<EditOrderMsgVO> verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) {
log.info("###################verifyData: 验证改单数据");
StringBuilder stringBuilder = new StringBuilder();
@ -2361,7 +2568,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newShipperName = openOrderDTO.getShipperName();
String shipperName = waybillEntity.getShipperName();
shipperName = StringUtil.isBlank(shipperName)?"":shipperName;
if(!ObjectUtil.equals(shipperName,newShipperName)){
// stringBuilder.append("发货人:").append(shipperName).append("-->").append(newShipperName).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
@ -2373,7 +2579,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newShipperMobile = openOrderDTO.getShipperMobile();
String shipperMobile = waybillEntity.getShipperMobile();
shipperMobile = StringUtil.isBlank(shipperMobile)?"":shipperMobile;
if(!ObjectUtil.equals(shipperMobile,newShipperMobile)){
// stringBuilder.append("发货人电话:").append(shipperMobile).append("-->").append(newShipperMobile).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
@ -2385,11 +2590,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newShipperAddress = openOrderDTO.getShipperAddress();
String shipperAddress = waybillEntity.getShipperAddress();
shipperAddress = StringUtil.isBlank(shipperAddress)?"":shipperAddress;
if(!ObjectUtil.equals(shipperAddress,newShipperAddress)){
// stringBuilder.append("发货人地址:").append(shipperAddress).append("-->").append(newShipperAddress).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
editOrderMsgVO.setItemName("发货人电话");
editOrderMsgVO.setItemName("发货人地址");
editOrderMsgVO.setOldValue(shipperAddress);
editOrderMsgVO.setNewValue(newShipperAddress);
msgList.add(editOrderMsgVO);
@ -2410,7 +2614,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newConsigneeName = openOrderDTO.getConsigneeName();
String consigneeName = waybillEntity.getConsigneeName();
consigneeName = StringUtil.isBlank(consigneeName)?"":consigneeName;
if(!ObjectUtil.equals(consigneeName,newConsigneeName)){
// stringBuilder.append("收货人:").append(consigneeName).append("-->").append(newConsigneeName).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
@ -2422,7 +2625,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newConsigneeMobile = openOrderDTO.getConsigneeMobile();
String consigneeMobile = waybillEntity.getConsigneeMobile();
consigneeMobile = StringUtil.isBlank(consigneeMobile)?"":consigneeMobile;
if(!ObjectUtil.equals(consigneeMobile,newConsigneeMobile)){
// stringBuilder.append("收货人电话:").append(consigneeMobile).append("-->").append(newConsigneeMobile).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
@ -2434,13 +2636,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newConsigneeAddress = openOrderDTO.getConsigneeAddress();
String consigneeAddress = waybillEntity.getConsigneeAddress();
consigneeAddress = StringUtil.isBlank(consigneeAddress)?"":consigneeAddress;
if(!ObjectUtil.equals(shipperAddress,newShipperAddress)){
// stringBuilder.append("发货人地址:").append(consigneeAddress).append("-->").append(newConsigneeAddress).append(";");
if(!ObjectUtil.equals(consigneeAddress,newConsigneeAddress)){
// stringBuilder.append("收货人地址:").append(consigneeAddress).append("-->").append(newConsigneeAddress).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
editOrderMsgVO.setItemName("货人地址");
editOrderMsgVO.setOldValue(shipperAddress);
editOrderMsgVO.setNewValue(newShipperAddress);
editOrderMsgVO.setItemName("货人地址");
editOrderMsgVO.setOldValue(consigneeAddress);
editOrderMsgVO.setNewValue(newConsigneeAddress);
msgList.add(editOrderMsgVO);
}
@ -2525,6 +2726,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
editOrderMsgVO.setNewValue(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_CHARGE_TYPE,newChargeType+""));
msgList.add(editOrderMsgVO);
}
BigDecimal newSubtotalFreight = waybillDetailDTO.getSubtotalFreight();
BigDecimal subtotalFreight = warehouseWayBillDetail.getSubtotalFreight();
if(subtotalFreight.compareTo(newSubtotalFreight) != 0){
// stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 单价修改").append(price).append("-->").append(newPrice).append(";");
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
editOrderMsgVO.setItemName("明细更新 "+warehouseWayBillDetail.getProductName() +" 运费小计修改 ");
editOrderMsgVO.setOldValue(subtotalFreight.toPlainString());
editOrderMsgVO.setNewValue(newSubtotalFreight.toPlainString());
msgList.add(editOrderMsgVO);
}
}
}
@ -2863,7 +3076,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newDestination = openOrderDTO.getDestination();
String destination = waybillEntity.getDestination();
if (!destination.equals(newDestination)) {
if (!ObjectUtil.equals(destination,newDestination)) {
stringBuilder.append("到站:").append(destination).append("-->").append(newDestination).append(";");
waybillEntity.setDestination(newDestination);
waybillEntity.setDestinationCode(openOrderDTO.getDestinationCode());
@ -2872,7 +3085,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newDestinationWarehouseName = openOrderDTO.getDestinationWarehouseName();
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
String departureWarehouseName = waybillEntity.getDepartureWarehouseName();
if (!destinationWarehouseId.equals(newDestinationWarehouseId)) {
if (!ObjectUtil.equals(destinationWarehouseId,newDestinationWarehouseId)) {
stringBuilder.append("目的仓:").append(departureWarehouseName).append("-->").append(newDestinationWarehouseName).append(";");
waybillEntity.setDestinationWarehouseId(newDestinationWarehouseId);
waybillEntity.setDestinationWarehouseName(newDestinationWarehouseName);
@ -2881,31 +3094,28 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newShipper = openOrderDTO.getShipper();
Long shipperId = waybillEntity.getShipperId();
String shipper = waybillEntity.getShipper();
if (!shipperId.equals(newShipperId)) {
if (!ObjectUtil.equals(shipperId,newShipperId)) {
stringBuilder.append("发货单位:").append(shipper).append("-->").append(newShipper).append(";");
waybillEntity.setShipper(newShipper);
waybillEntity.setShipperId(newShipperId);
}
String newShipperName = openOrderDTO.getShipperName();
String shipperName = waybillEntity.getShipperName();
shipperName = StringUtil.isBlank(shipperName) ? "" : shipperName;
if (!shipperName.equals(newShipperName)) {
if (!ObjectUtil.equals(shipperName,newShipperName)) {
stringBuilder.append("发货人:").append(shipperName).append("-->").append(newShipperName).append(";");
waybillEntity.setShipperName(newShipperName);
}
String newShipperMobile = openOrderDTO.getShipperMobile();
String shipperMobile = waybillEntity.getShipperMobile();
shipperMobile = StringUtil.isBlank(shipperMobile) ? "" : shipperMobile;
if (!shipperMobile.equals(newShipperMobile)) {
if (!ObjectUtil.equals(shipperMobile,newShipperMobile)) {
stringBuilder.append("发货人电话:").append(shipperMobile).append("-->").append(newShipperMobile).append(";");
waybillEntity.setShipperMobile(newShipperMobile);
}
String newShipperAddress = openOrderDTO.getShipperAddress();
String shipperAddress = waybillEntity.getShipperAddress();
shipperAddress = StringUtil.isBlank(shipperAddress) ? "" : shipperAddress;
if (!shipperAddress.equals(newShipperAddress)) {
if (!ObjectUtil.equals(shipperAddress,newShipperAddress)) {
stringBuilder.append("发货人地址:").append(shipperAddress).append("-->").append(newShipperAddress).append(";");
waybillEntity.setShipperAddress(newShipperAddress);
}
@ -2914,7 +3124,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newConsignee = openOrderDTO.getConsignee();
Long consigneeId = waybillEntity.getConsigneeId();
String consignee = waybillEntity.getConsignee();
if (!consigneeId.equals(newConsigneeId)) {
if (!ObjectUtil.equals(consigneeId,newConsigneeId)) {
stringBuilder.append("收货单位:").append(consignee).append("-->").append(newConsignee).append(";");
waybillEntity.setConsignee(newConsignee);
waybillEntity.setConsigneeId(newConsigneeId);
@ -2922,24 +3132,21 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newConsigneeName = openOrderDTO.getConsigneeName();
String consigneeName = waybillEntity.getConsigneeName();
consigneeName = StringUtil.isBlank(consigneeName) ? "" : consigneeName;
if (!consigneeName.equals(newConsigneeName)) {
if (!ObjectUtil.equals(consigneeName,newConsigneeName)) {
stringBuilder.append("收货人:").append(consigneeName).append("-->").append(newConsigneeName).append(";");
waybillEntity.setConsigneeName(newConsigneeName);
}
String newConsigneeMobile = openOrderDTO.getConsigneeMobile();
String consigneeMobile = waybillEntity.getConsigneeMobile();
consigneeMobile = StringUtil.isBlank(consigneeMobile) ? "" : consigneeMobile;
if (!consigneeMobile.equals(newConsigneeMobile)) {
if (!ObjectUtil.equals(consigneeMobile,newConsigneeName)) {
stringBuilder.append("收货人电话:").append(consigneeMobile).append("-->").append(newConsigneeMobile).append(";");
waybillEntity.setConsigneeMobile(newConsigneeMobile);
}
String newConsigneeAddress = openOrderDTO.getConsigneeAddress();
String consigneeAddress = waybillEntity.getConsigneeAddress();
consigneeAddress = StringUtil.isBlank(consigneeAddress) ? "" : consigneeAddress;
if (!shipperAddress.equals(newShipperAddress)) {
if (!ObjectUtil.equals(consigneeAddress,newConsigneeAddress)) {
stringBuilder.append("收货人地址:").append(consigneeAddress).append("-->").append(newConsigneeAddress).append(";");
waybillEntity.setConsigneeAddress(newConsigneeAddress);
}
@ -2999,7 +3206,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
Integer newNum = waybillDetailDTO.getNum();
Integer num = warehouseWayBillDetail.getNum();
if (!num.equals(newNum)) {
if (!ObjectUtil.equals(num,newNum)) {
stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 数量修改").append(num).append("-->").append(newNum).append(";");
warehouseWayBillDetail.setNum(newNum);
}
@ -3013,17 +3220,25 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Integer newChargeType = waybillDetailDTO.getChargeType();
Integer chargeType = warehouseWayBillDetail.getChargeType();
if (!chargeType.equals(newChargeType)) {
if (!ObjectUtil.equals(chargeType,newChargeType)) {
stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 计价方式修改").append(chargeType).append("-->").append(newChargeType).append(";");
warehouseWayBillDetail.setChargeType(newChargeType);
}
BigDecimal newSubtotalFreight = waybillDetailDTO.getSubtotalFreight();
BigDecimal subtotalFreight = warehouseWayBillDetail.getSubtotalFreight();
if(subtotalFreight.compareTo(newSubtotalFreight) != 0){
stringBuilder.append("明细更新:").append(warehouseWayBillDetail.getProductName()).append(" 运费小计修改").append(subtotalFreight).append("-->").append(newSubtotalFreight).append(";");
warehouseWayBillDetail.setSubtotalFreight(newSubtotalFreight);
}
warehouseWaybillDetailClient.updateEntityById(warehouseWayBillDetail);
}
}
Integer newTotalCount = openOrderDTO.getTotalCount();
Integer totalCount = waybillEntity.getTotalCount();
if (!totalCount.equals(newTotalCount)) {
if (!ObjectUtil.equals(totalCount,newTotalCount)) {
stringBuilder.append("货物总数:").append(totalCount).append("-->").append(newTotalCount).append(";");
waybillEntity.setTotalCount(newTotalCount);
}
@ -3100,14 +3315,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newPayType = openOrderDTO.getPayType();
String payType = waybillEntity.getPayType();
if (!payType.equals(newPayType)) {
if (!ObjectUtil.equals(payType,newPayType)) {
stringBuilder.append("支付方式:").append(payType).append("-->").append(newPayType).append(";");
waybillEntity.setPayType(newPayType);
}
String newPayWay = openOrderDTO.getPayWay();
String payWay = waybillEntity.getPayWay();
if (!payWay.equals(newPayWay)) {
if (!ObjectUtil.equals(payType,newPayType)) {
stringBuilder.append("付款方式:").append(payWay).append("-->").append(newPayWay).append(";");
waybillEntity.setPayWay(newPayWay);
}
@ -3149,14 +3364,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String newdeliveryWay = openOrderDTO.getDeliveryWay();
String deliveryWay = waybillEntity.getDeliveryWay();
if (!deliveryWay.equals(newdeliveryWay)) {
if (!ObjectUtil.equals(deliveryWay,newdeliveryWay)) {
stringBuilder.append("送货方式:").append(deliveryWay).append("-->").append(newdeliveryWay).append(";");
waybillEntity.setDeliveryWay(newdeliveryWay);
}
String newurgency = openOrderDTO.getUrgency();
String urgency = waybillEntity.getUrgency();
if (!urgency.equals(newurgency)) {
if (!ObjectUtil.equals(urgency,newurgency)) {
stringBuilder.append("紧急度:").append(urgency).append("-->").append(newurgency).append(";");
waybillEntity.setUrgency(newurgency);
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -266,4 +266,9 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
IPage<OrderDetailInfoVO> pageList = baseMapper.findOrderDetails(page,orderDetailsDTO);
return R.data(pageList);
}
@Override
public void updateWaybillNoIsNullByAdvanceIds(List<Long> advanceIds) {
baseMapper.updateWaybillNoIsNullByAdvanceIds(advanceIds);
}
}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -555,18 +555,24 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelList.setTenantId(tenantId);
parcelList.setIsDeleted(0);
parcelList.setStatus(1);
parcelList.setIsTransfer(1);
parcelList.setWarehouse(warehouseEntity.getName());
parcelList.setWarehouseId(warehouseId);
String waybillNo = advanceEntity.getWaybillNo();
if(StringUtil.isNotBlank(waybillNo)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(!Objects.isNull(waybillEntity)){
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
parcelList.setWaybillId(waybillEntity.getId());
parcelList.setWaybillNumber(waybillEntity.getWaybillNo());
parcelList.setSendWarehouseId(waybillEntity.getDepartureWarehouseId());
parcelList.setSendWarehouseId(departureWarehouseId);
parcelList.setSendWarehouseName(waybillEntity.getDepartureWarehouseName());
parcelList.setAcceptWarehouseId(waybillEntity.getDestinationWarehouseId());
parcelList.setAcceptWarehouseId(destinationWarehouseId);
parcelList.setAcceptWarehouseName(waybillEntity.getDestinationWarehouseName());
if(departureWarehouseId.equals(destinationWarehouseId)){
parcelList.setIsTransfer(0);
}
}
}
parcelList.setConditions(1);
@ -578,7 +584,6 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelList.setStockArticleId(orderId);
parcelList.setOrderCode(orderCode);
parcelList.setServiceNumber(advanceDetailEntity.getServiceNum());
parcelList.setIsTransfer(1);
parcelList.setAdvanceId(advanceId);
Long materialId = advanceDetailEntity.getMaterialId();

84
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -16,6 +17,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -23,6 +25,7 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -159,16 +162,18 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
}
String billladingCode = billladingEntity.getBillladingCode();
String updateMsg = verifyBilllading(billladingEntity,billladingDTO);
TrunklineBillladingLogEntity logEntity = new TrunklineBillladingLogEntity();
logEntity.setWarehouseId(warehouseId);
logEntity.setWarehouseName(warehouseName);
logEntity.setCreateUserName(AuthUtil.getUserName());
logEntity.setContent("修改提货单 billladingCode="+billladingCode);
logEntity.setContent("修改提货单 billladingCode="+billladingCode+" "+updateMsg);
logEntity.setBillladingId(billladingId);
logEntity.setBeforeOpreation(JSON.toJSONString(billladingEntity));
BeanUtil.copy(billladingDTO,billladingEntity);
updateById(billladingEntity);
// updateById(billladingEntity);
//先删除路线节点
billladingLineService.deleteByBillladingId(billladingId);
@ -195,6 +200,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
billladingEntity.setLineNameTitle(lineTitle);
updateById(billladingEntity);
//先删除所有对应的运单
billladingWaybillService.deletedByBillladingId(billladingId);
@ -224,6 +230,71 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
}
private String verifyBilllading(TrunklineBillladingEntity billladingEntity, BillladingDTO billladingDTO) {
StringBuilder stringBuilder = new StringBuilder();
String carNumber = billladingEntity.getCarNumber();
String newCarNumber = billladingDTO.getCarNumber();
if(!StringUtil.equals(carNumber,newCarNumber)){
stringBuilder.append("车牌号:").append(carNumber).append("-->").append(newCarNumber).append(";");
}
String driverName = billladingEntity.getDriverName();
String newDriverName = billladingDTO.getDriverName();
if(!StringUtil.equals(driverName,newDriverName)){
stringBuilder.append("司机:").append(driverName).append("-->").append(newDriverName).append(";");
}
String driverPhone = billladingEntity.getDriverPhone();
String newDriverPhone = billladingDTO.getDriverPhone();
if(!StringUtil.equals(driverPhone,newDriverPhone)){
stringBuilder.append("司机电话:").append(driverPhone).append("-->").append(newDriverPhone).append(";");
}
String carrierName = billladingEntity.getCarrierName();
String newCarrierName = billladingDTO.getCarrierName();
if(!StringUtil.equals(carrierName,newCarrierName)){
stringBuilder.append("承运商:").append(carrierName).append("-->").append(newCarrierName).append(";");
}
Integer planNum = billladingEntity.getPlanNum();
Integer newPlanNum = billladingDTO.getPlanNum();
if(!ObjectUtil.equals(planNum,newPlanNum)){
stringBuilder.append("预计件数:").append(planNum).append("-->").append(newPlanNum).append(";");
}
BigDecimal planWeight = billladingEntity.getPlanWeight();
BigDecimal newPlanWeight = billladingDTO.getPlanWeight();
if(!ObjectUtil.equals(planWeight,newPlanWeight)){
stringBuilder.append("预计重量:").append(planWeight).append("-->").append(newPlanWeight).append(";");
}
BigDecimal planVolume = billladingEntity.getPlanVolume();
BigDecimal newPlanVolume = billladingDTO.getPlanVolume();
if(!ObjectUtil.equals(planVolume,newPlanVolume)){
stringBuilder.append("预计重量:").append(planWeight).append("-->").append(newPlanWeight).append(";");
}
String chargeType = billladingEntity.getChargeType();
String newChargeType = billladingDTO.getChargeType();
if(!StringUtil.equals(chargeType,newChargeType)){
stringBuilder.append("计费模式:").append(DictBizCache.getValue(DictBizConstant.BILLLADING_CHARGE_TYPE,chargeType)).append("-->").append(DictBizCache.getValue(DictBizConstant.BILLLADING_CHARGE_TYPE,newChargeType)).append(";");
}
BigDecimal totalFee = billladingEntity.getTotalFee();
BigDecimal newTotalFee = billladingDTO.getTotalFee();
if(!ObjectUtil.equals(totalFee,newTotalFee)){
stringBuilder.append("提货费用:").append(totalFee.toPlainString()).append("-->").append(newTotalFee.toPlainString()).append(";");
}
String remark = billladingEntity.getRemark();
String newRemark = billladingDTO.getRemark();
if(!StringUtil.equals(remark,newRemark)){
stringBuilder.append("备注:").append(remark).append("-->").append(newRemark).append(";");
}
return stringBuilder.toString();
}
@Override
public void updateBillladingStatus(Long billladingId, Integer type,Long warehouseId,String warehouseName) {
log.info("#############updateBillladingStatus: 更新提货单状态 type={}",type);
@ -558,4 +629,13 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
return baseMapper.findAdvanceDetailList(orderCode);
}
@Override
public R findBillladingLogList(Long billladingId) {
List<TrunklineBillladingLogEntity> list = baseMapper.findBillladingLogList(billladingId);
return R.data(list);
}
}

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

@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -202,8 +203,8 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
}
@Override
public void updateScanStatus(List<Long> loadScanIds, String scanStatus) {
baseMapper.updateScanStatus(loadScanIds,scanStatus);
public void updateScanStatusAndTime(List<Long> loadScanIds, String scanStatus,Date unloadTime) {
baseMapper.updateScanStatusAndTime(loadScanIds,scanStatus,unloadTime);
}
@Override
@ -267,8 +268,8 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
}
@Override
public void updateScanStatusByLoadId(Long loadId, String scanStatus) {
baseMapper.updateScanStatusByLoadId(loadId,scanStatus);
public void updateScanStatusByLoadId(Long loadId, String scanStatus, Date unloadTime) {
baseMapper.updateScanStatusByLoadId(loadId,scanStatus,unloadTime);
}
@Override
@ -346,4 +347,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findListHasSignOrderIdByIds(loadScanIds);
}
@Override
public List<Long> findCarsLoadScanIdsByWaybillIds(List<Long> waybillIds) {
return baseMapper.findCarsLoadScanIdsByWaybillIds(waybillIds);
}
}

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

@ -1094,6 +1094,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long nodeId = carsLoadLineEntity.getNodeId();
String nodeName = carsLoadLineEntity.getNodeName();
List<TrunklineCarsOrderDTO> lineCarsOrderList = carsLoadLineDTO.getAddList();
//把lineCarsOrderList中的所有运单号合并成一个集合
List<String> waybillNos = lineCarsOrderList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList());
List<WarehouseWaybillEntity> freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos);
if(!CollUtil.isEmpty(freezeOrAbolishWaybillList)){
log.warn("##########saveNew: 运单有变动,请重新做计划");
throw new CustomerException(400, "运单有变动,请重新做计划");
}
for (TrunklineCarsOrderDTO carsOrderDTO : lineCarsOrderList) {
Integer planNum = carsOrderDTO.getPlanNum();
String orderCode = carsOrderDTO.getOrderCode();
@ -1286,6 +1293,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String receivingTimeStr = carsLoadDTO.getReceivingTimeStr();
BigDecimal countTransportCost = carsLoadDTO.getCountTransportCost();
BigDecimal settlementValue = carsLoadDTO.getSettlementValue();
String driverType = carsLoadDTO.getDriverType();
String outDriverPerson = carsLoadDTO.getOutDriverPerson();
List<TrunklineCarsLoadLineDTO> addCarsLoadLineList = carsLoadDTO.getAddCarsLoadLineList();
List<TrunklineCarsLoadLineDTO> removeCarsLoadLineList = carsLoadDTO.getRemoveCarsLoadLineList();
@ -1325,6 +1334,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setReceivingTime(CommonUtil.StringToDate(receivingTimeStr));
carsLoadEntity.setCountTransportCost(countTransportCost);
carsLoadEntity.setSettlementValue(settlementValue);
carsLoadEntity.setDriverType(driverType);
carsLoadEntity.setOutDriverPerson(outDriverPerson);
updateById(carsLoadEntity);
for (TrunklineCarsLoadLineDTO carsLoadLineDTO : removeCarsLoadLineList) {
@ -1417,6 +1428,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsOrderService.deleteByCarsOrderId(carsOrderId);
}
//把lineCarsOrderList中的所有运单号合并成一个集合
List<String> waybillNos = addList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList());
List<WarehouseWaybillEntity> freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos);
if(!CollUtil.isEmpty(freezeOrAbolishWaybillList)){
log.warn("##########saveNew: 运单有变动,请重新做计划");
throw new CustomerException(400, "运单有变动,请重新做计划");
}
for (TrunklineCarsOrderDTO trunklineCarsOrderDTO : addList) {
TrunklineCarsOrderEntity trunklineCarsOrderEntity = new TrunklineCarsOrderEntity();
BeanUtil.copy(trunklineCarsOrderDTO, trunklineCarsOrderEntity);
@ -1985,7 +2004,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setLoadStatus("90");
updateById(carsLoadEntity);
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3");
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3",new Date());
try {
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId);
@ -2284,7 +2303,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseName + "装车,配载计划目的仓 " + carsLoadScanEntity.getFinalNodeName() + ",数据来源仓库 " + fromWarehouseName;
String content = "包件在 " + warehouseName + " "+(StringUtil.isBlank(trayName)?"扫码": "托盘("+trayName+")")+" 装车,配载计划目的仓 " + 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,
@ -3174,6 +3193,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setUnloadAbnormal(1);
trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
trunklineCarsLoadScanEntity.setUnloadNum(1);
trunklineCarsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanEntity.setIsSupple(0);
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
Long loadScanId = trunklineCarsLoadScanEntity.getId();
@ -3223,6 +3243,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
trunklineCarsLoadScanEntity.setUnloadNodeName(warehouseName);
trunklineCarsLoadScanEntity.setUnloadNum(1);
trunklineCarsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
Long loadScanId = trunklineCarsLoadScanEntity.getId();
@ -3267,6 +3288,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNodeId(warehouseId);
carsLoadScanEntity.setUnloadNodeName(warehouseName);
carsLoadScanEntity.setUnloadNum(carsLoadScanEntity.getNum());
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setScanStatus("2");
trayCode = carsLoadScanEntity.getTrayCode();
if (!StringUtil.isBlank(trayCode)) {
@ -3349,6 +3371,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNodeId(warehouseId);
carsLoadScanEntity.setUnloadNodeName(warehouseName);
carsLoadScanEntity.setUnloadAbnormal(0);
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setScanStatus("2");
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
@ -3490,6 +3513,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
e.setScanStatus("2");
e.setUnloadNodeId(warehouseId);
e.setUnloadNodeName(warehouseName);
e.setUnloadTime(date);
Long finalNodeId = e.getFinalNodeId();
if(!finalNodeId.equals(warehouseId)){
isAbnormal = 1;
@ -3963,6 +3987,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String carsNo = carsLoadEntity.getCarsNo();
Date date = new Date();
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.findEntityByLoadIdAndOrderPackageCode(loadId, orderPackageCode);
if (Objects.isNull(carsLoadScanEntity)) {
//因为没有装车记录,补装车记录
@ -3980,9 +4005,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setLoadingAbnormal(1);
carsLoadScanEntity.setUnloadAbnormal(1);
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(new Date());
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignAbnormal(1);
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
carsLoadScanEntity.setRemark("无数据签收");
trunklineCarsLoadScanService.save(carsLoadScanEntity);
@ -4021,9 +4047,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setLoadingAbnormal(1);
carsLoadScanEntity.setUnloadAbnormal(1);
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(new Date());
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignAbnormal(1);
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
carsLoadScanEntity.setRemark("有数据异常签收");
trunklineCarsLoadScanService.save(carsLoadScanEntity);
@ -4082,8 +4109,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
carsLoadScanEntity.setScanStatus("3");
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(new Date());
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
//生成签收记录
@ -4149,7 +4177,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R signZeroOrder(Long signOrderId, Long carsLoadScanId, Integer enterNum, String remark) {
Date date = new Date();
TrunklineLoadSignOrderEntity signOrderEntity = trunklineLoadSignOrderService.getById(signOrderId);
if (Objects.isNull(signOrderEntity)) {
log.warn("##############signZeroOrder: 签收单信息不存在 signOrderId={}", signOrderId);
@ -4178,7 +4206,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setScanStatus("3");
carsLoadScanEntity.setUnloadNum(enterNum);
carsLoadScanEntity.setSignTime(new Date());
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setUnloadTime(date);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
//生成签收记录
@ -4253,6 +4282,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
entity.setScanStatus("3");
entity.setUnloadNum(t.getNum());
entity.setSignTime(date);
entity.setUnloadTime(date);
if(entity.getType().equals(1)){
String scanCode = entity.getScanCode();
List<DistributionParcelListEntity> parcelList = parcelListMap.get(scanCode);
@ -4589,7 +4619,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
Date date = new Date();
trunklineCarsLoadScanService.updateScanStatus(loadScanIds, "3");
trunklineCarsLoadScanService.updateScanStatusAndTime(loadScanIds, "3",new Date());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds);
@ -5436,6 +5466,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setIsSupple(0);
trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
loadScanId = trunklineCarsLoadScanEntity.getId();
@ -5486,6 +5517,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setUnloadNum(1);
trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
loadScanId = trunklineCarsLoadScanEntity.getId();
@ -5606,6 +5638,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNodeName(warehouseName);
carsLoadScanEntity.setUnloadNum(carsLoadScanEntity.getNum());
carsLoadScanEntity.setScanStatus("2");
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadTime(new Date());
trayCode = carsLoadScanEntity.getTrayCode();
if (!StringUtil.isBlank(trayCode)) {
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
@ -5714,6 +5748,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setOrderCode(orderCode1);
carsLoadScanEntity.setWaybillNo(waybillNo1);
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setIsData(1);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
} else {
@ -5846,6 +5882,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setScanStatus("2");
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode,

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillOrderServiceImpl.java

@ -39,4 +39,9 @@ public class TrunklineWaybillOrderServiceImpl extends BaseServiceImpl<TrunklineW
public Integer findTotalNumByWaybillNoAndOrderCode(Long waybillId, String orderCode) {
return baseMapper.findTotalNumByWaybillNoAndOrderCode(waybillId,orderCode);
}
@Override
public List<Long> findAdvanceIdsByWaybillIds(List<Long> waybillIds) {
return baseMapper.findAdvanceIdsByWaybillIds(waybillIds);
}
}

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

@ -20,6 +20,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
@ -44,5 +45,16 @@ public class WarehouseWaybillDTO extends WarehouseWaybillEntity {
private List<String> waybillNoList;
private String documentMakingTimeStartStr;
private String documentMakingTimeEndStr;
private Date documentMakingTimeStartDate;
private Date documentMakingTimeEndDate;
private String createTimeStartStr;
private String createTimeEndStr;
private Date createTimeStartDate;
private Date createTimeEndDate;
}

31
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java

@ -1,5 +1,7 @@
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.service.IWarehouseWaybillService;
@ -73,4 +75,33 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient {
public Long findLastData(String waybillNo) {
return warehouseWaybillService.findLastData(waybillNo);
}
@Override
public List<WarehouseWaybillEntity> findListByWaybillIds(List<Long> waybillIds) {
//通过waybillIds查询List<WarehouseWaybillEntity>
QueryWrapper<WarehouseWaybillEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id", waybillIds);
return warehouseWaybillService.list(queryWrapper);
}
@Override
public void updateList(List<WarehouseWaybillEntity> waybillEntities) {
warehouseWaybillService.updateBatchById(waybillEntities);
}
@Override
public List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(List<String> waybillNos) {
return warehouseWaybillService.findFreezeOrAbolishByWaybillNos(waybillNos);
}
@Override
public void updateWaybillFreezeStatusByWaybillIds(List<Long> waybillIds) {
UpdateWrapper<WarehouseWaybillEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("freeze_user_name",null)
.set("freeze_time",null)
.set("freeze_status",0)
.in("id",waybillIds);
warehouseWaybillService.update(updateWrapper);
}
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailMapper.java

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface WarehouseWayBillDetailMapper extends BaseMapper<WarehouseWayBillDetail> {
List<WarehouseWayBillDetail> findByWaybillIds(List<Long> ids);
}

9
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillDetailMapper.xml

@ -2,5 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.warehouse.mapper.WarehouseWayBillDetailMapper">
<select id="findByWaybillIds" resultType="com.logpm.warehouse.entity.WarehouseWayBillDetail">
select *
from logpm_warehouse_waybill_detail
where waybill_id in
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and is_deleted = 0
</select>
</mapper>

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java

@ -56,4 +56,6 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
Long findLastData(@Param("waybillNo") String waybillNo);
List<WarehouseWaybillEntity> findWaybillBillladingList(@Param("waybillNo") String waybillNo,@Param("warehouseId") Long warehouseId);
List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(@Param("waybillNos") List<String> waybillNos);
}

94
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -155,9 +155,88 @@
<if test="param.warehouseId != null">
and (departure_warehouse_id = #{param.warehouseId} or destination_warehouse_id = #{param.warehouseId})
</if>
<if test="param.waybillNo != null">
and waybill_no = #{param.waybillNo}
<if test="param.waybillNo != null and param.waybillNo != ''">
and Locate(#{param.waybillNo},waybill_no) > 0
</if>
<if test="param.orderNo != null and param.orderNo != ''">
and Locate(#{param.orderNo},order_no) > 0
</if>
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName != ''">
and Locate(#{param.destinationWarehouseName},destination_warehouse_name) > 0
</if>
<if test="param.departureWarehouseName != null and param.departureWarehouseName != ''">
and Locate(#{param.departureWarehouseName},departure_warehouse_name) > 0
</if>
<if test="param.customerTrain != null and param.customerTrain != ''">
and Locate(#{param.customerTrain},customer_train) > 0
</if>
<if test="param.brand != null and param.brand != ''">
and Locate(#{param.brand},brand) > 0
</if>
<if test="param.shipper != null and param.shipper != ''">
and Locate(#{param.shipper},shipper) > 0
</if>
<if test="param.shipperName != null and param.shipperName != ''">
and Locate(#{param.shipperName},shipper_name) > 0
</if>
<if test="param.shipperMobile != null and param.shipperMobile != ''">
and Locate(#{param.shipperMobile},shipper_mobile) > 0
</if>
<if test="param.consignee != null and param.consignee != ''">
and Locate(#{param.consignee},consignee) > 0
</if>
<if test="param.consigneeName != null and param.consigneeName != ''">
and Locate(#{param.consigneeName},consignee_name) > 0
</if>
<if test="param.consigneeMobile != null and param.consigneeMobile != ''">
and Locate(#{param.consigneeMobile},consignee_mobile) > 0
</if>
<if test="param.destination != null and param.destination != ''">
and Locate(#{param.destination},destination) > 0
</if>
<if test="param.departure != null and param.departure != ''">
and Locate(#{param.departure},departure) > 0
</if>
<if test="param.payType != null">
and pay_type = #{param.payType}
</if>
<if test="param.payWay != null">
and pay_way = #{param.payWay}
</if>
<if test="param.deliveryWay != null">
and delivery_way = #{param.deliveryWay}
</if>
<if test="param.urgency != null">
and urgency = #{param.urgency}
</if>
<if test="param.transportType != null">
and transport_type = #{param.transportType}
</if>
<if test="param.transportType != null">
and transport_type = #{param.transportType}
</if>
<if test="param.waybillStatus != null">
and waybill_status = #{param.waybillStatus}
</if>
<if test="param.pickupCompleteOrNot != null">
and pickup_complete_or_not = #{param.pickupCompleteOrNot}
</if>
<if test="param.trunklineCompleteOrNot != null">
and trunkline_complete_or_not = #{param.trunklineCompleteOrNot}
</if>
<if test="param.documentMakingTimeStartDate != null">
and document_making_time &gt;= #{param.documentMakingTimeStartDate}
</if>
<if test="param.documentMakingTimeEndDate != null">
and document_making_time &lt;= #{param.documentMakingTimeEndDate}
</if>
<if test="param.createTimeStartDate != null">
and create_time &gt;= #{param.createTimeStartDate}
</if>
<if test="param.createTimeEndDate != null">
and create_time &lt;= #{param.createTimeEndDate}
</if>
order by create_time desc
</select>
@ -183,4 +262,15 @@
limit 10
</select>
<select id="findFreezeOrAbolishByWaybillNos" resultType="com.logpm.warehouse.entity.WarehouseWaybillEntity">
select *
from logpm_warehouse_waybill
where 1=1
and (abolish_status = 1 or freeze_status = 1)
and waybill_no in
<foreach collection="waybillNos" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailService.java

@ -23,4 +23,5 @@ public interface IWarehouseWayBillDetailService {
void deleteByWaybillDetailId(Long waybillDetailId);
List<WarehouseWayBillDetail> findByWaybillIds(List<Long> ids);
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java

@ -67,4 +67,6 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
* @return
*/
List<PrintPreviewVO> printBatch(String ids, String tempId) throws Exception;
List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(List<String> waybillNos);
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailServiceImpl.java

@ -69,4 +69,9 @@ public class WarehouseWayBillDetailServiceImpl implements IWarehouseWayBillDetai
public void deleteByWaybillDetailId(Long waybillDetailId) {
warehouseWayBillDetailMapper.deleteById(waybillDetailId);
}
@Override
public List<WarehouseWayBillDetail> findByWaybillIds(List<Long> ids) {
return warehouseWayBillDetailMapper.findByWaybillIds(ids);
}
}

36
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -45,6 +45,7 @@ import org.springblade.common.constant.OldSystemDataPushConfig;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -669,22 +670,28 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
page.setCurrent(waybillDTO.getPageNum());
page.setSize(waybillDTO.getPageSize());
Long warehouseId = waybillDTO.getWarehouseId();
waybillDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getDocumentMakingTimeStartStr()));
waybillDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getDocumentMakingTimeEndStr()));
waybillDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getCreateTimeStartStr()));
waybillDTO.setCreateTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getCreateTimeEndStr()));
IPage<WarehouseWaybillVO> pageList = baseMapper.pageList(page, waybillDTO);
List<WarehouseWaybillVO> records = pageList.getRecords();
for (WarehouseWaybillVO record : records) {
// Integer waybillType = record.getWaybillType();
// if(waybillType.equals(2)){
// String orderCode = record.getWaybillNo();
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
// record.setHandleNum(stockArticleEntity.getHandQuantity());
// }
Long waybillId = record.getId();
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWayBillDetailService.findByWaybillId(waybillId);
record.setDetailList(wayBillDetailList);
if(!records.isEmpty()){
//把records中的id取出作为一个集合
List<Long> ids = records.stream().map(WarehouseWaybillVO::getId).collect(Collectors.toList());
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWayBillDetailService.findByWaybillIds(ids);
//把wayBillDetailList通过waibillId分组
Map<Long, List<WarehouseWayBillDetail>> map = wayBillDetailList.stream().collect(Collectors.groupingBy(WarehouseWayBillDetail::getWaybillId));
for (WarehouseWaybillVO record : records) {
Long waybillId = record.getId();
record.setDetailList(map.get(waybillId));
}
pageList.setRecords(records);
}
pageList.setRecords(records);
return pageList;
}
@ -786,6 +793,11 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
return list;
}
@Override
public List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(List<String> waybillNos) {
return baseMapper.findFreezeOrAbolishByWaybillNos(waybillNos);
}
private PrintPreviewVO buildPrintWallet(WarehouseWaybillEntity warehouseWaybillEntity, List<WarehouseWayBillDetail> warehouseWayBillDetails, BasicPrintTemplateEntity template) throws Exception {
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());

Loading…
Cancel
Save