Browse Source

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

dev-pushdata-important
Diss 1 year ago
parent
commit
cda46c2179
  1. 1
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataCarrierEntity.java
  2. 1
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java
  3. 8
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java
  4. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java
  5. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  6. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java
  7. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java
  8. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  9. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  10. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java
  11. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java
  12. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  13. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml
  14. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  15. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  16. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  17. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  18. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  19. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  20. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  21. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  22. 21
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  23. 86
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  24. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  25. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDisStockListDetailService.java
  26. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  27. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  28. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  29. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  30. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  31. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java
  32. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java
  33. 370
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  34. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  35. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  36. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  37. 39
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  38. 73
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  39. 714
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  40. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  41. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  42. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  43. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  44. 43
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  45. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  46. 166
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  47. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  48. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  49. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

1
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataCarrierEntity.java

@ -208,4 +208,5 @@ public class BasicdataCarrierEntity extends TenantEntity {
@ApiModelProperty(value = "预留5")
private String reserve5;
}

1
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java

@ -319,4 +319,5 @@ public class BasicdataVehicleEntity extends TenantEntity {
@ApiModelProperty(value = "预留5")
private String reserve5;
}

8
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java

@ -80,4 +80,12 @@ public interface IBasicdataClientClient {
@GetMapping(API_PREFIX+"/findListByClientName")
List<JSONObject> findListByClientName(@RequestParam String clientName);
/**
* 根据Id查询客户
* @param mallId
* @return
*/
@GetMapping(API_PREFIX+"/getMallById")
BasicdataClientEntity getMallById(Long mallId);
}

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java

@ -60,6 +60,11 @@ public class DistributionAppDeliveryListVO extends DistributionDeliveryListEntit
*/
@ApiModelProperty(value = "完成装车客户数")
private Integer loadCusNub;
/**
* 装车客户数
*/
@ApiModelProperty(value = "装车件数")
private Integer scannedNumber;
/**
* 配车状态

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

@ -274,7 +274,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//查询客服岗位
List<DictBiz> numberRules = DictBizCache.getList("work_order_number_rules");
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
if (numberRules.isEmpty()) {
if (ObjectUtils.isNull(numberRules) || numberRules.isEmpty()) {
log.info("注意,注意!工单号字典未配置!请配置!");
} else {
Optional<DictBiz> first2 = pcWorkOrder.stream().filter(i -> i.getDictKey().equals(workOrderType)).findFirst();

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java

@ -114,4 +114,10 @@ public class BasicdataClientClient implements IBasicdataClientClient {
return basicdataClientService.findListByClientName(clientName);
}
@Override
@GetMapping(API_PREFIX+"/getMallById")
public BasicdataClientEntity getMallById(Long mallId) {
return basicdataClientService.getById(mallId);
}
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java

@ -1,5 +1,6 @@
package com.logpm.basicdata.feign;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.service.IBasicdataCodeService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
@ -16,4 +17,5 @@ public class BasicdataCodeClient implements IBasicdataCodeClient {
public String getCodeByType(Integer type,String warehouseCode,String orderCode) {
return basicdataCodeService.getCodeByType(type,warehouseCode,orderCode);
}
}

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -482,4 +482,26 @@ public class DistributionDeliveryListController extends BladeController {
R r = distributionSignforService.signforInPC(distrilbutionloadingscanDTO);
return r;
}
@PostMapping("/cancelDelivery")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "PC签收包件")
public R cancelDelivery(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R r = distributionDeliveryListService.cancelDelivery(distrilbutionloadingscanDTO.getDeliveryId());
if (r.isSuccess()){
//取消成功,维护配送单状态和数量
distributionDeliveryListService.maintenanceDeliveryNum(distrilbutionloadingscanDTO.getDeliveryId());
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
}
return r;
}
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -31,6 +31,7 @@ import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.excel.DistributionSignforExcel;
import com.logpm.distribution.excel.DistributionSignforOwnExcel;
import com.logpm.distribution.service.IDistributionAsyncService;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.service.impl.DistributionAddvalueServiceImpl;
@ -85,6 +86,8 @@ public class DistributionSignforController extends BladeController {
private final IDistributionAsyncService distributionAsyncService;
private final IDistributionDeliveryListService distributionDeliveryListService;
/**
* 签收管理 详情
*/
@ -306,8 +309,11 @@ public class DistributionSignforController extends BladeController {
@ApiOperation(value = "修改", notes = "传入distributionSignfor")
public R update(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
R r= distributionSignforService.recheck(distributionSignfor.getId());
R r= distributionSignforService.recheck(distributionSignfor);
if (r.isSuccess()){
//维护配送状态
distributionDeliveryListService.maintenanceDeliveryInfo(distributionSignfor.getDeliveryId());
}
// return R.status(distributionSignforService.updateById(distributionSignfor));
return r;
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java

@ -275,6 +275,13 @@ public class DistrilbutionBillLadingController extends BladeController {
return R.status(distrilbutionBillLadingService.ownSaveOrUpdate(distrilbutionBillLading));
}
@PostMapping("/cancelBillLoding")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "批量取消自提单", notes = "传入distrilbutionBillLading")
public R cancelBillLoding(@Valid @RequestBody DistrilbutionBillLadingDTO distrilbutionBillLadingDTO) {
return distrilbutionBillLadingService.cancelBillLoding(distrilbutionBillLadingDTO.getBillLodingIds());
}
/**

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java

@ -42,6 +42,11 @@ public class DistrilbutionBillLadingDTO extends DistrilbutionBillLadingEntity {
*
*/
private String name;
/**
*
*/
private String billLodingIds;
/**
* 提货批次
*/

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -210,7 +210,7 @@
left JOIN logpm_distribution_signfor lds on lddl.id = lds.delivery_id
LEFT JOIN logpm_distribution_reservation ldr on ldr.id = lds.reservation_id
<where>
lddl.is_deleted = 0 AND (IF(lddl.delivery_number is null ,0,lddl.delivery_number) + IF(lddl.inventory_nub is null ,0,lddl.inventory_nub)) > 0
lddl.is_deleted = 0 AND (IF(lddl.delivery_number is null ,0,lddl.delivery_number) + IF(lddl.inventory_nub is null ,0,lddl.inventory_nub)) > 0 AND lddl.customers_number > 0
<if test="param.trainNumber != null and param.trainNumber!=''">
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
@ -757,7 +757,7 @@
logpm_distribution_delivery_list lddl
left join logpm_distribution_delivery_self ldds on lddl.id =ldds.delivery_id
<where>
lddl.is_deleted =0 and lddl.warehouse_id =#{warehouseId}
lddl.is_deleted =0 and lddl.customers_number > 0 and lddl.warehouse_id =#{warehouseId}
<if test=" param.type != null and param.type != ''">and lddl.type = #{param.type}</if>
<if test="array != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(array)">
and lddl.id in
@ -1171,6 +1171,7 @@
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id
<where>
ldr.reservation_status != 40
<if test="deliveryListId != null and deliveryListId != ''">
and lds.delivery_id = #{deliveryListId}
</if>

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml

@ -256,9 +256,6 @@
</select>
<select id="getLoadCountNum" resultType="int">
SELECT
count( ldl.id )
FROM
@ -268,8 +265,6 @@
ldl.is_deleted = 0
AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != '1'
AND ldl.is_abnormal_loading = 1
</select>
<select id="selectLoadingNumByReservationId" resultType="java.lang.Integer">
SELECT (IF((SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE reservation_id = #{reservationId} AND scan_state != 1 AND is_abnormal_loading != 2) is null,0,(SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE reservation_id = #{reservationId} AND scan_state != 1 AND is_abnormal_loading != 2)))

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

@ -171,4 +171,11 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<Map<String, Integer>> selectAllErrorReservationOrder();
List<DistributionParcelListEntity> findByWaybillNumber(@Param("waybillNumber") String waybillNumber);
/**
* 还原包件状态 -- 未出库
* @param packageIds
* @return
*/
Integer restorePakcageByIds(@Param("packageIds")List<Long> packageIds);
}

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

@ -1073,6 +1073,12 @@
where order_code = #{orderCode}
and warehouse_id = #{warehouseId}
</update>
<update id="restorePakcageByIds">
UPDATE logpm_distribution_parcel_list SET order_package_status = 20,order_package_reservation_status = 10,order_package_loading_status = 10 WHERE id IN
<foreach collection="packageIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
<select id="selectAllErrorReservationOrder">
SELECT reservation_id,COUNT(1) as num from (

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java

@ -70,8 +70,7 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
List<DistributionStockupOrderListVO> selectStockupOrderList(@Param("reservationId")Long reservationId,@Param("isZero") String isZero);
List<DistributionStockupStockListVO> selectStockupStockList(@Param("reservationId")Long reservationId);
List<DistributionStockupStockListVO> selectStockupStockListNew(@Param("reservationId")Long reservationId,@Param("warehouseId") Long warehouseId);
List<DistributionStockupStockListVO> selectStockupStockListNew(@Param("reservationId")Long reservationId,@Param("warehouseId")Long warehouseId,@Param("mallName")String mallName);
Integer selectOrderNumByReservationId(@Param("reservationId")Long reservationId);
Integer selectPlanNum(@Param("reservationId")Long reservationId);
@ -119,8 +118,8 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
/**
* 查询预约单下指定订单包件列表
* @param id
* @param id1
* @param orderIds
* @param param
* @return
*/
IPage<DistributionParcelListEntity> getReservationPackage(IPage<DistributionParcelListEntity> page,@Param("orderIds") List<Long> orderIds,@Param("param")Map<String,Object> param);
@ -133,8 +132,8 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
/**
* 通过预约和订单查询预约订单中间表
* @param id
* @param id1
* @param reservationId
* @param warehourseId
* @return
*/
List<DistributionParcelListEntity> selectPackageByReservationAndStockArticle(@Param("reservationId") Long reservationId,@Param("stockArticleId") Long stockArticleId,@Param("warehourseId") Long warehourseId);

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -335,10 +335,12 @@
LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id
WHERE
ldrs.reservation_id = #{reservationId}
AND ldsl.market_name = #{mallName}
group by ldsl.cargo_number
) t
LEFT JOIN logpm_distribution_stock_list ldslNew ON t.cargo_number = ldslNew.cargo_number
LEFT JOIN logpm_distribution_stock ldss ON ldss.stock_list_id = t.id where ldslNew.is_deleted = 0
LEFT JOIN logpm_distribution_stock ldss ON ldss.stock_list_id = t.id
where ldslNew.is_deleted = 0
<!-- SELECT-->
<!-- ldsl.sku AS sku,-->
@ -1156,6 +1158,7 @@
ldsa.order_code,
ldrs.is_have_data,
ldsa.id AS id,
ldsa.waybill_number AS waybillNumber,
ldrs.is_zero
FROM
logpm_distribution_reservation AS lds

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.excel.DistributionSignforExcel;
import com.logpm.distribution.vo.*;
@ -313,4 +314,10 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @return
*/
List<DistributionAppPackageDetailVO> signingPackageDetail(@Param("reservationId") Long reservationId);
/**
* 查询配送单关联预约
* @param deliveryId
*/
List<DistributionReservationEntity> selectReservationByDeliveryId(Long deliveryId);
}

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

@ -349,7 +349,7 @@
JOIN logpm_distribution_delivery_list lddl ON lddl.id = lds.delivery_id
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
<where>
lds.is_deleted = 0 and ldr.is_deleted = 0 and lddl.is_deleted = 0
lds.is_deleted = 0 and ldr.is_deleted = 0 and lddl.is_deleted = 0 AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0
<if test="param.mallName != null and param.mallName!=''">
and ldr.mall_name like concat('%',#{param.mallName},'%')
</if>
@ -1279,4 +1279,11 @@
ldr.id = #{reservationId}
</select>
<select id="selectReservationByDeliveryId">
SELECT ldr.* FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
WHERE lds.delivery_id = #{deliveryId}
AND ldr.reservation_status != 40
AND ldr.is_deleted = 0
AND lds.is_deleted = 0
</select>
</mapper>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java

@ -152,4 +152,6 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
List<DistributionMerchantStockListVO> selectMerchantHaveDataStockListInfo(@Param("stockListId") Long stockListId);
List<DistributionMerchantStockListVO> selectMerchantNotHaveDataStockListInfo(@Param("stockListId")Long id);
IPage<DistributionStockListAllocationVO> listAllocationOrder(IPage<Object> page, @Param("param") DistributionStockListEntity distributionStockListEntity);
}

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -387,6 +387,30 @@
</select>
<select id="listAllocationOrder" resultType="com.logpm.distribution.vo.DistributionStockListAllocationVO">
select lwug.position_code allocationTitle,
lwug.allocation_id,
ldsi.market_name marketName,
sum(lwug.num) num,
lwug.create_time createTime,
ldsi.cargo_unit cargoUnit,
ldsi.unpack,
ldsi.quantity_stock quantityStock,
ldsi.unpacking_quantity unpackingQuantity,
ldsi.description_goods descriptionGoods
FROM
logpm_distribution_stock_list ldsi
left join logpm_distribution_stock_list_info ldsli on ldsli.material_id = ldsi.material_id AND ldsli.warehouse_id = ldsi.warehouse_id
AND ldsi.market_id = ldsli.market_id and ldsli.incoming_batch = ldsi.incoming_batch
LEFT JOIN logpm_warehouse_updown_goods lwug ON ldsli.parcel_list_id = lwug.association_id and lwug.association_type = '3'
<where>
<if test="param.id != null "> and ldsi.id = #{param.id}</if>
</where>
group by lwug.allocation_id
</select>
<select id="selectAllStockList" resultType="com.logpm.distribution.vo.DistributionStockListVO">
SELECT
ldsl.tenant_id,

21
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java

@ -19,8 +19,12 @@ package com.logpm.distribution.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionDeliveryDetailsDTO;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.vo.*;
@ -91,4 +95,21 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
List<DistrilbutionBillLadingVO> exportDistributionBillLading(@Param("param") Map<String, Object> param, @Param("idArr") List<String> idArr);
/**
* 取消订制品包件
* @param billLodingIds
* @return
*/
Integer cancelBillLadingPackage(@Param("ids")List<Long> ids);
/**
* 查询自提单关联包件
* @param billLodingIds
* @return
*/
List<DistributionParcelListEntity> selectBillLadingPackage(@Param("ids")List<Long> ids);
List<DistributionDeliveryDetailsEntity> selectBillLadingInventory(@Param("ids")List<Long> ids);
}

86
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -25,6 +25,12 @@
<result column="certificate_type" property="certificateType"/>
<result column="total_cost" property="totalCost"/>
</resultMap>
<update id="cancelBillLadingPackage">
UPDATE logpm_distrilbution_bill_package SET packet_bar_status = 3 WHERE bill_lading_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="pageList" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO">
select dbl.id,GROUP_CONCAT(DISTINCT dsa.service_number) serviceNumber,GROUP_CONCAT(DISTINCT dsa.waybill_number) waybillNumber,GROUP_CONCAT(DISTINCT dsa.consignee_unit)
@ -121,40 +127,35 @@
</select>
<select id="exportDistributionBillLading" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO">
select dbl.id,
dsa.service_number serviceNumber,
dsa.waybill_number waybillNumber,
dsa.consignee_unit consigneeUnit,
dsa.customer_name customerName,
dsa.customer_telephone customerTelephone,
dsa.warehouse,
dsa.warehouse_entry_time warehouseEntryTime,
dsa.storage_fee storageFee,
dsa.total_number totalNumber,
dbl.certificate_type certificateType,
dsa.brand,
dsa.type_service typeService,
dbl.pick_up_time pickUpTime,
dbl.consignee,
dbl.delivery_document deliveryDocument,
dbl.conditions,
dbl.total_cost totalCost,
dbl.pick_up_plate pickUpPlate,
dbl.pickup_batch pickupBatch,
(
select COUNT(lds.id)
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock lds on lds.stock_list_id = lddd.stock_list_id
where lddd.bill_lading_id = dbl.id
) + (
select COUNT(lds.id)
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_stock lds on lds.stock_article = ldbs.stock_article_id
where ldbs.bill_lading_id = dbl.id
) stopNum
from logpm_distrilbution_bill_lading dbl
LEFT JOIN logpm_distribution_stock_article dsa
on dbl.stock_article_id = dsa.id
SELECT
dbl.id,
dsa.service_number AS serviceNumber,
dsa.waybill_number AS waybillNumber,
dsa.consignee_unit AS consigneeUnit,
dsa.customer_name AS customerName,
dsa.customer_telephone AS customerTelephone,
dsa.warehouse,
dsa.warehouse_entry_time AS warehouseEntryTime,
dsa.storage_fee AS storageFee,
(count(DISTINCT ldbp.id,0)+count(DISTINCT lddd.quantity,0)) AS totalNumber,
dbl.certificate_type AS certificateType,
dsa.brand,
dsa.type_service AS typeService,
dbl.pick_up_time AS pickUpTime,
dbl.consignee,
dbl.delivery_document AS deliveryDocument,
dbl.conditions,
dbl.total_cost AS totalCost,
dbl.pick_up_plate AS pickUpPlate,
dbl.pickup_batch AS pickupBatch,
count(DISTINCT ldbls.id ) AS stopNum
FROM
logpm_distrilbution_bill_lading dbl
LEFT JOIN logpm_distrilbution_bill_stock AS ldbs ON ldbs.bill_lading_id = dbl.id AND ldbs.order_status != 3
LEFT JOIN logpm_distribution_stock_article dsa ON ldbs.stock_article_id = dsa.id
LEFT JOIN logpm_distrilbution_bill_package AS ldbp ON ldbp.stock_article_id = dsa.id AND ldbp.bill_lading_id = dbl.id AND ldbp.packet_bar_status != 3
LEFT JOIN logpm_distribution_delivery_details AS lddd ON lddd.bill_lading_id = dbl.id AND lddd.inventory_status != 3
LEFT JOIN logpm_distribution_bill_lading_scan ldbls ON ldbls.bill_lading_id = dbl.id
<where>
dbl.is_deleted = 0
<if test="param.serviceNumber != null and param.serviceNumber != ''">
@ -219,6 +220,7 @@
</if>
</where>
GROUP BY dbl.id
</select>
<select id="selectDistrilbutionBillLadingPage" resultMap="distrilbutionBillLadingResultMap">
@ -453,5 +455,21 @@
LEFT JOIN logpm_distribution_stockup_info ldsi on dbl.id = ldsi.reservation_id and ldsi.stock_up_type = #{distrilbutionBillLading.stockupType}
where ldsi.stockup_id = #{distrilbutionBillLading.id};
</select>
<select id="selectBillLadingPackage"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT ldpl.* FROM logpm_distrilbution_bill_package AS ldbp LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id
WHERE packet_bar_status != '3' AND bill_lading_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectBillLadingInventory"
resultType="com.logpm.distribution.entity.DistributionDeliveryDetailsEntity">
SELECT * FROM logpm_distribution_delivery_details WHERE inventory_status != '3' AND bill_lading_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml

@ -123,6 +123,7 @@
CASE
WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) = 0 THEN 20
WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) > 0 THEN 10
WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) &lt; 0 THEN 30
END AS conditions,
(select GROUP_CONCAT(DISTINCT ldpl.material_name )
from logpm_distribution_parcel_list ldpl

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

@ -68,4 +68,10 @@ public interface IDisStockListDetailService extends BaseService<DisStockListDeta
*/
OrderPackgeCodeDataVO getPrintDetail(Map<String, Object> disStockListDetail) throws Exception;
/**
* 取消库存品包件信息
* @param stockListId
* @param billLadingId
*/
void cancelInventoryPackageByReservationIdAnStockListId(Long stockListId, Long billLadingId);
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -25,6 +25,7 @@ import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.excel.DistributionDeliveryListExcel;
import com.logpm.distribution.vo.*;
@ -405,6 +406,19 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
void maintenanceDeliveryNum(Long deliveryId);
/**
* 取消配送任务
* @param deliveryId
*/
R cancelDelivery(Long deliveryId);
/**
* 查询配送任务下异常包件信息
* @param deliveryId
* @return
*/
List<DistributionLoadscanEntity> selectAbnormalLoadingBydeliveryId(Long deliveryId);
/**
* 查询签收预约客户包件信息

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

@ -180,4 +180,10 @@ public interface IDistributionParcelListService extends BaseService<Distribution
*/
List<DistributionParcelListEntity> findByWaybillNumber(String waybillId);
/**
* 批量还原包件状态
* @param packageIds
* @return
*/
Integer restorePakcageByIds(List<Long> packageIds);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -173,7 +173,7 @@ public interface IDistributionReservationService extends BaseService<Distributio
List<DistributionStockupOrderListVO> selectStockupOrderList(Long reservationId,String isZero);
List<DistributionStockupStockListVO> selectStockupStockList(Long reservationId,Long warehouseId);
List<DistributionStockupStockListVO> selectStockupStockList(Long reservationId,Long warehouseId,String mallName);
Integer selectOrderNumByReservationId(Long reservationId);

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java

@ -22,6 +22,7 @@ import com.logpm.distribution.dto.DistributionAddvalueDTO;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.dto.DistrilbutionAppsignforDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionSignPrintEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.excel.DistributionSignforExcel;
@ -244,7 +245,7 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* 推送签收信息到工厂
* @param id
*/
R recheck(Long id);
R recheck(DistributionSignforDTO distributionSignforDTO);
/**
* 查询是否可以进行复核签收
@ -275,4 +276,11 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
R signingPackageDetail(Long reservationId);
/**
* 查询配送关联预约单
* @param deliveryId
* @return
*/
List<DistributionReservationEntity> selectReservationByDeliveryId(Long deliveryId);
}

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

@ -182,6 +182,12 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/
List<DistributionMerchantStockListVO> getMerchantStockList(String materielCode);
/**
* 维护库存品的占用数量
* @param stockListId
* @param quantity
*/
void updateInventoryQuantityOccupied(Long stockListId, Integer quantity);
// /**

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java

@ -214,4 +214,11 @@ public interface IDistrilbutionBillLadingService extends BaseService<Distrilbuti
R getReceivedImage(BillLadingAppDTO billLadingAppDTO);
boolean signImages(DistrilbutionBillLadingDTO distrilbutionBillLading);
/**
* 批量取消自提单
* @param billLodingIds
* @return
*/
R cancelBillLoding(String billLodingIds);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java

@ -20,6 +20,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
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.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -248,6 +249,15 @@ public class DisStockListDetailServiceImpl extends BaseServiceImpl<DisStockListD
}
}
@Override
public void cancelInventoryPackageByReservationIdAnStockListId(Long stockListId, Long billLadingId) {
UpdateWrapper<DisStockListDetailEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda().eq(DisStockListDetailEntity::getStockListId,stockListId)
.eq(DisStockListDetailEntity::getReservationId,billLadingId)
.set(DisStockListDetailEntity::getStockPackageStatus,2);
this.update(updateWrapper);
}
/**
* 赋值模板转换
* @param id

370
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
@ -577,8 +578,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//查询当前扫描的包件是否进行了装车
DistributionParcelListEntity parcelList = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (!Objects.isNull(parcelList)){
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelList.getOrderPackageLoadingStatus())){
if (!Objects.isNull(parcelList)) {
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelList.getOrderPackageLoadingStatus())) {
return Resp.scanFail("操作失败", "包件已装车");
}
}
@ -601,8 +602,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
if (distrilbutionloadingscanDTO.getType() == 1) {
if (!Objects.isNull(parcelList)){
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelList.getOrderPackageLoadingStatus())){
if (!Objects.isNull(parcelList)) {
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelList.getOrderPackageLoadingStatus())) {
return Resp.scanFail("操作失败", "包件已装车");
}
}
@ -669,14 +670,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
Map<String,Object> map = new HashMap();
Map<String, Object> map = new HashMap();
String distrilbutionloadingscanDTOJson = JSONObject.toJSONString(distrilbutionloadingscanDTO);
map.put("distrilbutionloadingscanDTO",distrilbutionloadingscanDTOJson);
map.put("distrilbutionloadingscanDTO", distrilbutionloadingscanDTOJson);
String parcelListEntityJson = JSONObject.toJSONString(parcelListEntity);
map.put("parcelListEntity",parcelListEntityJson);
map.put("myCurrentWarehouseId",myCurrentWarehouse.getId());
map.put("parcelListEntity", parcelListEntityJson);
map.put("myCurrentWarehouseId", myCurrentWarehouse.getId());
String reservationEntityJson = JSONObject.toJSONString(reservationEntity);
map.put("reservationEntity",reservationEntityJson);
map.put("reservationEntity", reservationEntityJson);
log.info(">>>>>>>>>>>>> 进入延迟队列处理包件相关信息状态");
@ -871,7 +872,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// String str = getLoadingMsg(distrilbutionloadingscanDTO);
Integer carLaodNum = getCarLaodNum(distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanSuccessWithData("装车成功", "装车" + carLaodNum + "件", carLaodNum);
return Resp.scanSuccessWithData("装车成功", "装车" + carLaodNum + "件", carLaodNum);
}
private void extracteOrderPackageStatus(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO, DistributionParcelListEntity parcelListEntity, BasicdataWarehouseEntity myCurrentWarehouse, DistributionReservationEntity reservationEntity) {
@ -1051,7 +1052,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@NotNull
private String getLoadingMsg(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
return "装车" + getCarLaodNum(distrilbutionloadingscanDTO.getDeliveryId()) + "件";
return "装车" + getCarLaodNum(distrilbutionloadingscanDTO.getDeliveryId()) + "件";
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -1498,7 +1499,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403,"请选择仓库!!");
return R.fail(403, "请选择仓库!!");
// throw n/**/ew CustomerException(403, "仓库信息不能为空");
}
/*
@ -2196,154 +2197,157 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionAppDeliveryListVO> selectDistributionAppDeliveryListPage(IPage<DistributionAppDeliveryListVO> page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {
//获取当前登录人
BladeUser user = AuthUtil.getUser();
String roleId = user.getRoleId();
//判断当前登录人是否为司机
List<DistributionAppDeliveryListVO> distributionAppDeliveryListVOS = new ArrayList<>();
boolean delivery = false;
String value1 = DictBizCache.getValue("role_class", "delivery_driver_new");
if (roleId.contains(value1)) delivery = true;
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
try {
//获取当前登录人
BladeUser user = AuthUtil.getUser();
String roleId = user.getRoleId();
//判断当前登录人是否为司机
boolean delivery = false;
String value1 = DictBizCache.getValue("role_class", "delivery_driver_new");
if (roleId.contains(value1)) delivery = true;
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// R<String> value = dictBizClient.getValue("role_class", roleId);
if (delivery) {
//查询当前登录人的配送任务
BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId());
if (null == driverArtery) {
log.error("没有司机的信息!!");
return page.setRecords(distributionAppDeliveryListVOS);
}
//查询司机的任务
List<Long> deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId());
if (!deliveryIds.isEmpty()) {
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds, myCurrentWarehouse.getId());
if (delivery) {
//查询当前登录人的配送任务
BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId());
if (null == driverArtery) {
log.error("没有司机的信息!!");
return page.setRecords(distributionAppDeliveryListVOS);
}
//查询司机的任务
List<Long> deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId());
if (!deliveryIds.isEmpty()) {
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds, myCurrentWarehouse.getId());
} else {
return page.setRecords(distributionAppDeliveryListVOS);
}
} else {
return page.setRecords(distributionAppDeliveryListVOS);
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, null, myCurrentWarehouse.getId());
}
} else {
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, null, myCurrentWarehouse.getId());
}
//转换字典字段
for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) {
distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId()));
// 调用下 查询装车件数的方法
//查询备货区
if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) {
List<String> list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId());
QueryWrapper<DistributionStockupInfoEntity> queryWrapper = new QueryWrapper();
log.info(">>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}", distributionAppDeliveryListVOS);
//转换字典字段
for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) {
if (list.size() > 1) {
queryWrapper.in("reservation_id", list);
} else {
queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId());
}
List<DistributionStockupInfoEntity> list1 = distributionStockupInfoService.list(queryWrapper);
if (!list1.isEmpty()) {
DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0);
DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId());
if (ObjectUtils.isNotNull(distributionStockupEntity)) {
distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea());
distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId()));
// 调用下 查询装车件数的方法
//查询备货区
if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) {
List<String> list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId());
QueryWrapper<DistributionStockupInfoEntity> queryWrapper = new QueryWrapper();
if (list.size() > 1) {
queryWrapper.in("reservation_id", list);
} else {
queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId());
}
List<DistributionStockupInfoEntity> list1 = distributionStockupInfoService.list(queryWrapper);
if (!list1.isEmpty()) {
DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0);
DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId());
if (ObjectUtils.isNotNull(distributionStockupEntity)) {
distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea());
} else {
distributionAppDeliveryListVO.setStockupArea("无数据");
}
} else {
distributionAppDeliveryListVO.setStockupArea("无数据");
}
}
//查询包件签收件数
Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper<DistributionLoadscanEntity>().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getSignforState, 2)).intValue();
//查询库存品签收件数
Integer nad = distributionLoadscaninvnMapper.selectCount(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscaninvnEntity::getSignforState, 2)).intValue();
//维护计划数
List<DistributionReservationEntity> reservationEntityList = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId());
if (Func.isNotEmpty(reservationEntityList)) {
int packageNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationNum).sum();
int invertoryNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum();
distributionAppDeliveryListVO.setDeliveryNumber(packageNum + invertoryNum);
} else {
distributionAppDeliveryListVO.setStockupArea("无数据");
continue;
}
}
//查询包件签收件数
Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper<DistributionLoadscanEntity>().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getSignforState, 2)).intValue();
//查询库存品签收件数
Integer nad = distributionLoadscaninvnMapper.selectCount(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscaninvnEntity::getSignforState, 2)).intValue();
//维护计划数
List<DistributionReservationEntity> reservationEntityList = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId());
if (Func.isNotEmpty(reservationEntityList)) {
int packageNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationNum).sum();
int invertoryNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum();
distributionAppDeliveryListVO.setDeliveryNumber(packageNum + invertoryNum);
} else {
return null;
}
distributionAppDeliveryListVO.setSignNub(lad + nad);
//查询完成客户数
Integer cusCount = baseMapper.selectCompletecusCount(distributionAppDeliveryListVO.getId());
//查询完成订单数
AtomicInteger ordCount = new AtomicInteger();
distributionAppDeliveryListVO.setSignNub(lad + nad);
//查询完成客户数
Integer cusCount = baseMapper.selectCompletecusCount(distributionAppDeliveryListVO.getId());
//查询完成订单数
AtomicInteger ordCount = new AtomicInteger();
// List<DistributionAppStockArticleVO> distributionAppStockArticleVOS = baseMapper.selectDistributionAppDeliveryOrderO(distributionAppDeliveryListVO);
List<DistributionStockArticleVO> deliveryStockArticleInfo = baseMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId());
List<DistributionStockArticleVO> deliveryStockArticleInfo = baseMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId());
// deliveryStockArticleInfo.forEach();
List<DistributionReservationEntity> distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId());
distributionReservationEntities.forEach(r -> {
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId());
reservationStockarticleEntityList.forEach(rs -> {
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()).eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(loadscanEntityList)) {
int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
if (rs.getReservationNum() == loadSum) {
ordCount.getAndIncrement();
List<DistributionReservationEntity> distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId());
distributionReservationEntities.forEach(r -> {
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId());
reservationStockarticleEntityList.forEach(rs -> {
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()).eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(loadscanEntityList)) {
int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
if (rs.getReservationNum() == loadSum) {
ordCount.getAndIncrement();
}
}
}
});
});
});
// distributionReservationMapper.selectPackageByReservationAndStockArticle()
// for (DistributionAppStockArticleVO distributionAppStockArticleVO : distributionAppStockArticleVOS) {
// if (distributionAppStockArticleVO.getLoadingNub() >= distributionAppStockArticleVO.getReservationNum()) {
// ordCount += 1;
// }
// }
distributionAppDeliveryListVO.setLoadCusNub(cusCount);
distributionAppDeliveryListVO.setLoadOrdNub(ordCount.get());
//查询下面的预约单
List<DistributionSignforEntity> distributionSignforEntityList = distributionSignforMapper.selectList(new QueryWrapper<DistributionSignforEntity>().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionAppDeliveryListVO.getId()));
//提取id
List<Long> reList = distributionSignforEntityList.stream().map(DistributionSignforEntity::getId).collect(Collectors.toList());
distributionAppDeliveryListVO.setType_name(dictBizClient.getValue("distribution_type", distributionAppDeliveryListVO.getType()).getData());
//查询是否配车
Integer aLong = 0;
Integer aLong2 = 0;
distributionAppDeliveryListVO.setVehicleStatus_name("已配车");
distributionAppDeliveryListVO.setDeliStatus_name("配送中");
if (distributionAppDeliveryListVO.getDeliveryStatus().equals("4")) {
distributionAppDeliveryListVO.setDeliStatus_name("完成");
}
if (distributionAppDeliveryListVO.getKind().equals("1")) {
aLong = distributionDeliverySelfMapper.selectCount(new QueryWrapper<DistributionDeliverySelfEntity>().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue();
} else {
aLong2 = distributionDeliveryTripartiteMapper.selectCount(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue();
}
if (aLong == 0 && aLong2 == 0) {
distributionAppDeliveryListVO.setVehicleStatus_name("未配车");
}
//查询是否备货
distributionAppDeliveryListVO.setIsstock("备货未完成");
List<DistributionStockEntity> stockEntityList = distributionStockMapper.selectList(new QueryWrapper<DistributionStockEntity>().lambda().eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId()));
if (Func.isNotEmpty(stockEntityList)) {
Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数
int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum();
if (sum == deliveryNumber) {
distributionAppDeliveryListVO.setIsstock("备货完成");
distributionAppDeliveryListVO.setLoadCusNub(cusCount);
distributionAppDeliveryListVO.setLoadOrdNub(ordCount.get());
//查询下面的预约单
List<DistributionSignforEntity> distributionSignforEntityList = distributionSignforMapper.selectList(new QueryWrapper<DistributionSignforEntity>().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionAppDeliveryListVO.getId()));
//提取id
List<Long> reList = distributionSignforEntityList.stream().map(DistributionSignforEntity::getId).collect(Collectors.toList());
distributionAppDeliveryListVO.setType_name(dictBizClient.getValue("distribution_type", distributionAppDeliveryListVO.getType()).getData());
//查询是否配车
Integer aLong = 0;
Integer aLong2 = 0;
distributionAppDeliveryListVO.setVehicleStatus_name("已配车");
distributionAppDeliveryListVO.setDeliStatus_name("配送中");
if (distributionAppDeliveryListVO.getDeliveryStatus().equals("4")) {
distributionAppDeliveryListVO.setDeliStatus_name("完成");
}
}
//查询司机
List<DistributionAppDeliverySelfVO> distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId());
if (!distributionAppDeliverySelfVOS.isEmpty()) {
StringBuilder stringBuilder = new StringBuilder();
distributionAppDeliverySelfVOS.forEach(e -> {
if (e.getIsMaster() == 2) {
stringBuilder.append(e.getDriverName()).append("(主)");
} else {
stringBuilder.append(e.getDriverName()).append("(副)");
if (distributionAppDeliveryListVO.getKind().equals("1")) {
aLong = distributionDeliverySelfMapper.selectCount(new QueryWrapper<DistributionDeliverySelfEntity>().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue();
} else {
aLong2 = distributionDeliveryTripartiteMapper.selectCount(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue();
}
if (aLong == 0 && aLong2 == 0) {
distributionAppDeliveryListVO.setVehicleStatus_name("未配车");
}
//查询是否备货
distributionAppDeliveryListVO.setIsstock("备货未完成");
List<DistributionStockEntity> stockEntityList = distributionStockMapper.selectList(new QueryWrapper<DistributionStockEntity>().lambda().eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId()));
if (Func.isNotEmpty(stockEntityList)) {
Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数
int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum();
if (sum == deliveryNumber) {
distributionAppDeliveryListVO.setIsstock("备货完成");
}
});
distributionAppDeliveryListVO.setDriverName(stringBuilder.toString());
}
//查询司机
List<DistributionAppDeliverySelfVO> distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId());
if (!distributionAppDeliverySelfVOS.isEmpty()) {
StringBuilder stringBuilder = new StringBuilder();
distributionAppDeliverySelfVOS.forEach(e -> {
if (e.getIsMaster() == 2) {
stringBuilder.append(e.getDriverName()).append("(主)");
} else {
stringBuilder.append(e.getDriverName()).append("(副)");
}
});
distributionAppDeliveryListVO.setDriverName(stringBuilder.toString());
}
}
} catch (Exception e) {
log.error(">>>>>>>> 司机配送装车查询 报错", e);
}
return page.setRecords(distributionAppDeliveryListVOS);
}
@Override
@ -3020,9 +3024,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//此订单包件数量统计
AtomicInteger orderPackageNum = new AtomicInteger();
if (Func.isEmpty(oldOrder.get(s.getId()))) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单");
}
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity();
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) {
@ -3051,7 +3055,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()).ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()).ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()).notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
if (Func.isEmpty(distributionParcelListEntities)) {
log.error("##############添加空订单");
throw new RuntimeException(s.getOrderCode()+"无可用包件!!!");
throw new RuntimeException(s.getOrderCode() + "无可用包件!!!");
}
distributionParcelListEntities.forEach(dp -> {
if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
@ -3164,9 +3168,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(packageListInfo)) {
packageListInfo.forEach(p -> {
if (Func.isEmpty(oldPackageList.get(p.getId()))) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单");
}
//为该订单新增了包件
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
@ -3186,9 +3190,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
});
//进行取消包件的数据清理
oldPackageList.forEach((a, b) -> {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单");
}
DistributionReservationPackageEntity reservationPackageEntity = b.get(0);
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
@ -3285,9 +3289,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
});
if (Func.isNotEmpty(oldOrder)) {
oldOrder.forEach((m, n) -> {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单");
}
DistributionReservationStockarticleEntity reservationStockarticleEntity = n.get(0);
if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
@ -4169,16 +4173,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<Long> orderIds = reservationStockarticleEntityList.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList());
if (Func.isNotEmpty(orderIds)) {
//查询该客户的非零但订单包间
IPage<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackage(page,orderIds, distributionDeliveryInfoDTO);
IPage<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackage(page, orderIds, distributionDeliveryInfoDTO);
parcelListVOIPage.setTotal(parcelListEntityList.getTotal());
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackageNew(distributionDeliveryInfoDTO);
log.info(">>>>>> parcelListEntityList {}",parcelListEntityList);
log.info(">>>>>> parcelListEntityList {}", parcelListEntityList);
List<DistributionParcelListVO> parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList.getRecords());
for (DistributionParcelListVO distributionParcelListVO : parcelListVOList) {
log.info(">>>>>> distributionParcelListVO {}",distributionParcelListVO);
log.info(">>>>>> distributionParcelListVO {}", distributionParcelListVO);
if (Func.isNotEmpty(loadingDataMap)) {
DistributionLoadscanEntity loadscanEntity = loadingDataMap.get(distributionParcelListVO.getId());
log.info(">>>>>> loadscanEntity {}",loadscanEntity);
log.info(">>>>>> loadscanEntity {}", loadscanEntity);
if (Func.isNotEmpty(loadscanEntity)) {
if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
@ -4224,7 +4228,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
}
log.info(">>>>>> distributionParcelListVO2 {}",distributionParcelListVO);
log.info(">>>>>> distributionParcelListVO2 {}", distributionParcelListVO);
distributionParcelListVOS.add(distributionParcelListVO);
}
@ -5134,7 +5138,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
if (Func.isNotEmpty(parcelListEntities) && parcelListEntities.size() == 1) {
DistributionParcelListEntity parcelListEntity = parcelListEntities.get(0);
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())){
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())) {
//包件已装车
log.error("重复异常装车,:{}", parcelListEntity.getOrderPackageCode());
return Resp.scanFail("操作失败", "包件已装车");
@ -5289,13 +5293,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionReservationOrderPackageVO reservationOrderPackageVO = new DistributionReservationOrderPackageVO();
LambdaQueryWrapper<DistributionParcelListEntity> parcelListEntityLambdaQueryWrapper = Wrappers.<DistributionParcelListEntity>query().lambda()
.notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(),OrderPackageStatusConstant.yichuku.getValue())
.notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(), OrderPackageStatusConstant.yichuku.getValue())
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.eq(DistributionParcelListEntity::getStockArticleId, orderId);
if (Func.isNotEmpty(reservationPackageList)){
if (Func.isNotEmpty(reservationPackageList)) {
List<Long> packageIds = reservationPackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
if (Func.isNotEmpty(packageIds)){
parcelListEntityLambdaQueryWrapper.notIn(DistributionParcelListEntity::getId,packageIds);
if (Func.isNotEmpty(packageIds)) {
parcelListEntityLambdaQueryWrapper.notIn(DistributionParcelListEntity::getId, packageIds);
}
}
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(parcelListEntityLambdaQueryWrapper);
@ -6474,7 +6478,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询产品名称拼接
String productName = distributionReservationPackageService.getConcatThirdProductByOrderId(reservationId, stockArticleId);
String materialNames = distributionReservationPackageService.getConcatMaterialName(reservationId,stockArticleId);
String materialNames = distributionReservationPackageService.getConcatMaterialName(reservationId, stockArticleId);
temp.put("产品名称", productName);
//todo 单位是否需要查询物料表
@ -6744,6 +6748,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
@Transactional
public void maintenanceDeliveryNum(Long deliveryId) {
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId);
if (Func.isNotEmpty(deliveryListEntity)) {
@ -6754,11 +6759,58 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
deliveryListEntity.setDeliveryNumber(packageNum);
deliveryListEntity.setInventoryNub(inventoryNum);
}
deliveryListEntity.setCustomersNumber(distributionReservationEntities.size());
this.updateById(deliveryListEntity);
}
}
@Override
@Transactional
public R cancelDelivery(Long deliveryId) {
String method = "###################DistributionDeliveryListServiceImpl执行方法cancelDelivery,";
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId);
if (Func.isEmpty(deliveryListEntity)) {
log.info(method + "参数缺失deliveryId:{}", deliveryId);
return R.fail("服务器正忙!!!");
}
List<DistributionReservationEntity> reservationEntities = distributionSignforService.selectReservationByDeliveryId(deliveryId);
if (Func.isEmpty(reservationEntities)) {
log.info(method + "预约查询失败:{}", deliveryId);
return R.fail("服务器正忙!!!");
}
String reservationCodes = reservationEntities.stream().filter(f -> !f.getLoadingStatus().equals(ReservationLoadingStatusConstant.daizhuangche.getValue())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(","));
if (Func.isNotEmpty(reservationCodes)) {
log.info(method + "存在装车数据:{}", reservationCodes);
return R.fail(deliveryListEntity.getTrainNumber() + "存在装车包件!!!");
}
//该配送是否存在异常装车或者异常签收数据
List<DistributionLoadscanEntity> loadscanEntityList = distributionDeliveryListService.selectAbnormalLoadingBydeliveryId(deliveryId);
if (Func.isNotEmpty(loadscanEntityList)) {
log.info(method + "存在异常装车数据:{}", deliveryId);
return R.fail(reservationCodes + "存在异常装车、签收包条!!!");
}
boolean flag = false;
for (DistributionReservationEntity reservationEntity : reservationEntities) {
DistributionReservationDTO reservationDTO = Func.copy(reservationEntity, DistributionReservationDTO.class);
flag = distributionReservationService.cancelReservation(reservationDTO);
if (!flag) {
log.info(method + "取消预约失败:{}", deliveryId);
throw new RuntimeException("取消配送计划失败,请联系管理员");
}
}
return R.status(flag);
}
@Override
public List<DistributionLoadscanEntity> selectAbnormalLoadingBydeliveryId(Long deliveryId) {
return distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
.eq(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
.eq(DistributionLoadscanEntity::getIsAbnormalLoading, 2)
);
}
@Override
@Transactional
public void maintenanceDeliveryInfo(Long deliveryId) {
@ -6798,10 +6850,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionSignforEntity> list = distributionSignforService.list(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getDeliveryId, deliveryId)
);
if (!list.isEmpty()){
if (!list.isEmpty()) {
//查看所有的签收信息是否均已完成
boolean anyMatch = list.stream().allMatch(s -> s.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue()));
if (anyMatch){
if (anyMatch) {
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue());
}
}

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

@ -926,4 +926,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.findByWaybillNumber(waybillNumber);
}
@Override
public Integer restorePakcageByIds(List<Long> packageIds) {
return baseMapper.restorePakcageByIds(packageIds);
}
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -2863,8 +2863,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
public List<DistributionStockupStockListVO> selectStockupStockList(Long reservationId,Long warehouseId) {
return baseMapper.selectStockupStockListNew(reservationId,warehouseId);
public List<DistributionStockupStockListVO> selectStockupStockList(Long reservationId,Long warehouseId,String mallName) {
return baseMapper.selectStockupStockListNew(reservationId,warehouseId,mallName);
}
@Override

31
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -218,10 +218,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer abnormalLoading = distributionLoadscanMapper.selectAbnormalLoadingByReservationId(d.getReservationId());
//该客户的异常签收件数
Integer abnormalSigning = distributionLoadscanMapper.selectAbnormalSigningByReservationId(d.getReservationId());
// DistributionLoadingNumDTO reservationSigningNum = distributionReservationMapper.selectReservationSigningNum(d.getReservationId());
if (d.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue())){
List<DisStockListDetailEntity> disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(d.getReservationId());
if (Func.isNotEmpty(disStockListDetailEntities)){
@ -392,7 +389,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(packageLoadingMap.get(p.getId()))){
DistributionLoadscanEntity distributionLoadscanEntity = packageLoadingMap.get(p.getId());
detailDTO.setLoadingTime(distributionLoadscanEntity.getScanTime());
detailDTO.setLoadingStatusName(OrderPackageLoadingStatusConstant.weizhuancghe.getName());
detailDTO.setLoadingStatusName(OrderPackageLoadingStatusConstant.yizhuangche.getName());
if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
//签收
detailDTO.setSigningTime(distributionLoadscanEntity.getSigningTime());
@ -477,31 +474,34 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
@Transactional
public R recheck(Long id) {
public R recheck(DistributionSignforDTO distributionSignforDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail(403, "未授权!!!");
}
if (Func.isEmpty(id)){
log.error("参数缺失,signforId:{}",id);
if (Func.isEmpty(distributionSignforDTO.getId())){
log.error("参数缺失,signforId:{}",distributionSignforDTO.getId());
return null;
}
DistributionSignforEntity distributionSignfor = this.getById(id);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss.SSS");
DistributionSignforEntity distributionSignfor = this.getById(distributionSignforDTO.getId());
BladeUser user = AuthUtil.getUser();
distributionSignfor.setExamineUserId(user.getUserId());
distributionSignfor.setSigningStatus(SignforStatusConstant.yiqianshou.getValue());
//复核时间为签收时间
String format = sdf.format(new Date());
distributionSignfor.setSigningTime(format);
distributionSignfor.setExamineUserName(user.getNickName());
this.updatePicture(distributionSignforDTO);
this.updateById(distributionSignfor);
distributionAsyncService.sendReviewFactory(id,myCurrentWarehouse.getName(), myCurrentWarehouse.getId());
distributionAsyncService.sendReviewFactory(distributionSignforDTO.getId(),myCurrentWarehouse.getName(), myCurrentWarehouse.getId());
//还需要对未装车未签收的包件进行状态的回退
boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId());
if (!flag){
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse.getId());
}
//维护配送状态
distributionDeliveryListService.maintenanceDeliveryInfo(distributionSignfor.getDeliveryId());
return R.success("操作成功");
}
@ -758,6 +758,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.data(details);
}
@Override
public List<DistributionReservationEntity> selectReservationByDeliveryId(Long deliveryId) {
return baseMapper.selectReservationByDeliveryId(deliveryId);
}
private boolean judgmentSignIsHavePackage(Long reservationId) {
boolean flag = false;
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
@ -4120,6 +4126,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
@Override
@Transactional
public Boolean updatePicture(DistributionSignforDTO distributionSignfor) {
if (ObjectUtils.isNotNull(distributionSignfor.getMap())) {

39
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -40,7 +40,6 @@ import com.logpm.distribution.vo.app.DistributionMerchantStockListVO;
import com.logpm.distribution.vo.app.StockMallVO;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
@ -220,7 +219,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
/**
*
* @param distributionStockListDTO
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
@ -297,6 +295,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
stockListEntity.setUnpackingQuantity( list.get(0).getUnpackingQuantity() + distributionStockListDTO.getUnpackingQuantity());
this.updateById(stockListEntity);
//添加拆包记录
DistributionUnpackingDetailsEntity distributionUnpackingDetails= new DistributionUnpackingDetailsEntity();
distributionUnpackingDetails.setStockArticleId(Optional.ofNullable(list.get(0).getStockArticleId()).orElse(null));
@ -465,7 +464,31 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
@Override
public IPage<DistributionStockListAllocationVO> listAllocation(IPage<Object> page, Map<String, Object> distributionStockList) {
DistributionStockListEntity distributionStockListEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockList), DistributionStockListEntity.class);
return baseMapper.listAllocation(page,distributionStockListEntity);
IPage<DistributionStockListAllocationVO> pageList = null;
Long marketId = distributionStockListEntity.getMarketId();
Long materialId = distributionStockListEntity.getMaterialId();
String incomingBatch = distributionStockListEntity.getIncomingBatch();
Long warehouseId = distributionStockListEntity.getWarehouseId();
QueryWrapper<DistributionStockListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("market_id",marketId)
.eq("material_id",materialId)
.eq("incoming_batch",incomingBatch)
.eq("warehouse_id",warehouseId);
distributionStockListEntity = getOne(queryWrapper);
if(Objects.isNull(distributionStockListEntity)){
log.warn("##################listAllocation: 库存品信息不存在");
return null;
}
String sourceType = distributionStockListEntity.getSourceType();
if("1".equals(sourceType)){
pageList = baseMapper.listAllocationOrder(page,distributionStockListEntity);
}else{
pageList = baseMapper.listAllocation(page,distributionStockListEntity);
}
return pageList;
}
@Override
@ -681,6 +704,16 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return distributionMerchantStockListVOS;
}
@Override
@Transactional
public void updateInventoryQuantityOccupied(Long stockListId, Integer quantity) {
DistributionStockListEntity stockListEntity = this.getById(stockListId);
if (Func.isNotEmpty(stockListEntity)){
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - quantity);
this.updateById(stockListEntity);
}
}
}
// @Override

73
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -26,7 +26,9 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataCodeClient;
import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
@ -201,6 +203,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private DistributionStockListInfoMapper distributionStockListInfoMapper;
@Autowired
private IBasicdataClientClient basicdataClientClient;
@Override
public IPage<DistributionStockupVO> selectDistributionStockupPage(IPage<DistributionStockupVO> page, DistributionStockupVO distributionStockup) {
@ -1135,10 +1140,27 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public List<DistributionStockupStockListVO> selectStockupStockList(StockupDTO stockupDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("###########myCurrentWarehouse:{}",myCurrentWarehouse);
return null;
}
Long reservationId = stockupDTO.getReservationId();//预约单id
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Func.isEmpty(reservationEntity)){
log.error("###########查询预约失败reservationId:{}",reservationId);
return null;
}
String mallName = reservationEntity.getMallName();
if (Func.isBlank(mallName)){
//预约商场名称为空 查看是否存在商场ID
if (Func.isNotEmpty(reservationEntity.getMallId())){
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.getMallById(reservationEntity.getMallId());
mallName = basicdataClientEntity.getClientName();
}else {
log.error("###########预约单无商场信息:{}",reservationId);
}
}
if (stockupDTO.getTypeService().equals("3")) {
//自
@ -1167,30 +1189,29 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} else {
//商,市
List<DistributionStockupStockListVO> list = distributionReservationService.selectStockupStockList(reservationId,reservationEntity.getWarehouseId());
for (int i = 0; i < list.size(); i++) {
DistributionStockupStockListVO distributionStockupStockListVO = list.get(i);
if (distributionStockupStockListVO.getPlanNum().equals(distributionStockupStockListVO.getRealNum())) {
distributionStockupStockListVO.setCompleteStact(true);
}
if (Func.isNotEmpty(distributionStockupStockListVO.getAllocations())){
String[] ids = distributionStockupStockListVO.getAllocations().split(",");
List<WarehouseGoodsAllocationEntity> allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(ids);
for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) {
if (distributionStockupStockListVO.getAllocationList() == null) {
distributionStockupStockListVO.setAllocationList(new ArrayList<>());
}
Map<String, Object> map = new HashMap<>();
map.put("id", allocationInforById.getId());
map.put("name", allocationInforById.getQrCode());
distributionStockupStockListVO.getAllocationList().add(map);
}
}
}
List<DistributionStockupStockListVO> list = distributionReservationService.selectStockupStockList(reservationId,myCurrentWarehouse.getId(),mallName);
for (DistributionStockupStockListVO distributionStockupStockListVO : list) {
if (distributionStockupStockListVO.getPlanNum().equals(distributionStockupStockListVO.getRealNum())) {
distributionStockupStockListVO.setCompleteStact(true);
}
if (Func.isNotEmpty(distributionStockupStockListVO.getAllocations())) {
String[] ids = distributionStockupStockListVO.getAllocations().split(",");
List<WarehouseGoodsAllocationEntity> allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(ids);
for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) {
if (distributionStockupStockListVO.getAllocationList() == null) {
distributionStockupStockListVO.setAllocationList(new ArrayList<>());
}
Map<String, Object> map = new HashMap<>();
map.put("id", allocationInforById.getId());
map.put("name", allocationInforById.getQrCode());
distributionStockupStockListVO.getAllocationList().add(map);
}
}
}
return list;
}

714
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

File diff suppressed because it is too large Load Diff

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

@ -690,7 +690,6 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
logger.info("##############sendMtFactoryData 发送数据: {}", data);
//先获取token
String token = getMtToken();
//处理逻辑
@ -700,7 +699,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
.header("USERID", mtFactoryProperties.getUserid())
.header("USERPWD", MD5Utils.md5Hex(mtFactoryProperties.getUserpwd().getBytes(StandardCharsets.UTF_8)))
.header("Content-Type", "application/json")
.body(data).timeout(5 * 1000)
.body(data).timeout(30 * 1000)
.execute().body();
logger.info("##############sendMtFactoryData 接受数据: {}", result);
@ -718,7 +717,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
if (!Objects.isNull(jsonObject)) {
Integer code = jsonObject.getInteger("Result");
String message = jsonObject.getString("Message");
if (code.equals(0)) {
if (0==code) {
logger.info("##########sendMtFactoryData: 物流状态传递成功");
return Resp.success("物流状态传递成功");
} else {

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

@ -71,4 +71,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
Integer findSignNumByLoadIdAndNodeIdAndOrderCodeAndeWaybillNo(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo);
Integer findRealSignNumBySignOrderId(@Param("signOrderId") Long signOrderId);
void updateFinalNodeIdAndFinalNodeNameById(@Param("loadScanId") Long loadScanId, @Param("finalNodeId") Long finalNodeId, @Param("finalNodeName") String finalNodeName);
}

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

@ -281,4 +281,10 @@
where sign_order_id = #{signOrderId}
</select>
<update id="updateFinalNodeIdAndFinalNodeNameById">
update logpm_trunkline_cars_load_scan
set final_node_id = #{finalNodeId},
final_node_name = #{finalNodeName}
where id = #{loadScanId}
</update>
</mapper>

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

@ -67,4 +67,7 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<TrunklineCarsLoadScanEntity> findListByIds(List<Long> loadScanIds);
Integer findRealSignNumBySignOrderId(Long signOrderId);
void updateFinalNodeIdAndFinalNodeNameById(Long loadScanId, Long finalNodeId, String finalNodeName);
}

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

@ -871,9 +871,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<PacakgeDetailExcelDTO> pacakgeDetailExcelDTOS = EasyExcel.read(inputStream).head(PacakgeDetailExcelDTO.class).sheet(0).headRowNumber(2).doReadSync();
Map<String, List<PacakgeDetailExcelDTO>> listMap = pacakgeDetailExcelDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "-" + a.getTrainNumber()));
Map<String, List<PacakgeDetailExcelDTO>> listMap = pacakgeDetailExcelDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber()));
listMap.remove("null-null");
listMap.remove("null&null");
Set<String> set = listMap.keySet();
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = new ArrayList<>();
@ -882,7 +882,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
for (String str : set) {
List<PacakgeDetailExcelDTO> detailExcelDTOS = listMap.get(str);
PacakgeDetailExcelDTO pacakgeDetailExcelDTO = detailExcelDTOS.get(0);
String[] split = str.split("-");
String[] split = str.split("&");
String orderCode = split[0];
String trainNumber = split[1];
List<String> orderPackageCodes = new ArrayList<>();
@ -981,10 +981,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailEntities.add(advanceDetailModel);
}
int all = orderPackageCodes.size() + advanceDetailEntities.size();
if(all != advanceEntity.getTotalNum()){
advanceService.updateTotalNumById(advanceEntity.getId(),all);
}
// int all = orderPackageCodes.size() + advanceDetailEntities.size();
// if(all != advanceEntity.getTotalNum()){
// advanceService.updateTotalNumById(advanceEntity.getId(),all);
// }
}
advanceDetailService.saveBatch(advanceDetailEntities);
@ -1004,9 +1004,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<ImportCustomizedOuPaiDTO> importCustomizedOuPaiDTOS = EasyExcel.read(inputStream).head(ImportCustomizedOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync();
Map<String, List<ImportCustomizedOuPaiDTO>> listMap = importCustomizedOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "-" + a.getTrainNumber()));
Map<String, List<ImportCustomizedOuPaiDTO>> listMap = importCustomizedOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber()));
listMap.remove("null-null");
listMap.remove("null&null");
Set<String> set = listMap.keySet();
@ -1015,7 +1015,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
for (String str : set) {
List<ImportCustomizedOuPaiDTO> paiDTOList = listMap.get(str);
ImportCustomizedOuPaiDTO importCustomizedOuPaiDTO = paiDTOList.get(0);
String[] split = str.split("-");
String[] split = str.split("&");
String orderCode = split[0];
String trainNumber = split[1];
List<String> orderPackageCodes = new ArrayList<>();
@ -1091,10 +1091,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailEntities.add(advanceDetailModel);
}
int all = orderPackageCodes.size() + advanceDetailEntities.size();
if(all != trunklineAdvanceEntity.getTotalNum()){
advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all);
}
// int all = orderPackageCodes.size() + advanceDetailEntities.size();
// if(all != trunklineAdvanceEntity.getTotalNum()){
// advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all);
// }
}
advanceDetailService.saveBatch(advanceDetailEntities);
@ -1116,9 +1116,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
InputStream inputStream = file.getInputStream();
List<ImportStandardOuPaiDTO> importStandardOuPaiDTOS = EasyExcel.read(inputStream).head(ImportStandardOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync();
Map<String, List<ImportStandardOuPaiDTO>> listMap = importStandardOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "-" + a.getTrainNumber()));
Map<String, List<ImportStandardOuPaiDTO>> listMap = importStandardOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber()));
listMap.remove("null-null");
listMap.remove("null&null");
Set<String> set = listMap.keySet();
@ -1126,7 +1126,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
for (String str : set) {
List<ImportStandardOuPaiDTO> paiDTOList = listMap.get(str);
ImportStandardOuPaiDTO importStandardOuPaiDTO = paiDTOList.get(0);
String[] split = str.split("-");
String[] split = str.split("&");
String orderCode = split[0];
String trainNumber = split[1];
List<String> orderPackageCodes = new ArrayList<>();
@ -1168,6 +1168,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailModel.setWarehouseId(warehouseId);
advanceDetailModel.setWarehouseName(warehouseName);
advanceDetailModel.setAdvanceId(trunklineAdvanceEntity.getId());
advanceDetailModel.setOrderPackageCode(orderPackageCode);
advanceDetailModel.setOrderCode(orderCode);
advanceDetailModel.setBrand("欧派");
advanceDetailModel.setSystemType("线上");
@ -1218,10 +1219,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailEntities.add(advanceDetailModel);
}
int all = orderPackageCodes.size() + advanceDetailEntities.size();
if(all != trunklineAdvanceEntity.getTotalNum()){
advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all);
}
// int all = orderPackageCodes.size() + advanceDetailEntities.size();
// if(all != trunklineAdvanceEntity.getTotalNum()){
// advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all);
// }
}
advanceDetailService.saveBatch(advanceDetailEntities);

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

@ -162,4 +162,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findRealSignNumBySignOrderId(signOrderId);
}
@Override
public void updateFinalNodeIdAndFinalNodeNameById(Long loadScanId, Long finalNodeId, String finalNodeName) {
baseMapper.updateFinalNodeIdAndFinalNodeNameById(loadScanId,finalNodeId,finalNodeName);
}
}

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

@ -1776,7 +1776,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
isAbnormal = 0;
remark = "正常装车";
}
carsLoadScanEntity.setFinalNodeId(carsOrderEntity.getFinalNodeId());
Long finalNodeId = carsOrderEntity.getFinalNodeId();
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
String finalNodeName = null;
if(!Objects.isNull(finalNode)){
finalNodeName = finalNode.getName();
}
carsLoadScanEntity.setFinalNodeId(finalNodeId);
carsLoadScanEntity.setFinalNodeName(finalNodeName);
}
distributionParcelListClient.updateOrderPackageCodeById(packageId,"60");
distributionStockArticleClient.submitHandleNumByOrderId(1,articleId);
@ -1852,6 +1859,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer isData = 1;
Integer planNum = null;
Integer difficult = 0;
Long finalNodeId = null;
String finalNodeName = null;
String loadCode = carsLoadEntity.getCarsNo();
//判断订单是否在计划当中
QueryWrapper<TrunklineCarsOrderEntity> queryWrapper = new QueryWrapper<>();
@ -1864,6 +1873,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
isAbnormal = 1;
remark = "有数据,无计划,异常装车";
}else{
finalNodeId = carsOrderEntity.getFinalNodeId();
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
if(!Objects.isNull(finalNode)){
finalNodeName = finalNode.getName();
}
planNum = carsOrderEntity.getPlanNum();//计划件数
}
@ -1910,7 +1924,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setTrayCode(trayCode);
carsLoadScanEntity.setRemark(remark);
carsLoadScanEntity.setFromWarehouseId(warehouseId);
carsLoadScanEntity.setFinalNodeId(carsOrderEntity.getFinalNodeId());
carsLoadScanEntity.setFinalNodeId(finalNodeId);
carsLoadScanEntity.setFinalNodeName(finalNodeName);
trunklineCarsLoadScanService.save(carsLoadScanEntity);
loadScanId = carsLoadScanEntity.getId();
difficult = enterNum;
@ -2406,7 +2421,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
for (LoadScanFinalNodeIdVO loadScanFinalNodeIdVO : loadScanFinalNodeIdList) {
Long loadScanId = loadScanFinalNodeIdVO.getLoadScanId();
Long finalNodeId = loadScanFinalNodeIdVO.getFinalNodeId();
trunklineCarsLoadScanService.updateFinalNodeIdById(loadScanId,finalNodeId);
String finalNodeName = null;
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
if(!Objects.isNull(finalNode)){
finalNodeName = finalNode.getName();
}
trunklineCarsLoadScanService.updateFinalNodeIdAndFinalNodeNameById(loadScanId,finalNodeId,finalNodeName);
}
@ -3646,6 +3666,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String orderCode = carsLoadScanEntity.getOrderCode();
Long loadScanId = carsLoadScanEntity.getId();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
Integer isData = carsLoadScanEntity.getIsData();
Integer isAbnormal = 0;
if(warehouseId.equals(finalNodeId)){
carsLoadScanEntity.setUnloadAbnormal(0);
@ -3672,81 +3693,82 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId,warehouseName,loadId,loadCode,waybillId,waybillNo,orderCode,orderPackageCode,1,
1,1,isAbnormal,trayId,trayCode,trayName,fromWarehouseId,loadScanId,remark);
if(1 == isData){
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, fromWarehouseId);
if(Objects.isNull(parcelListEntity)){
log.warn("##############unloadPackage: 包件信息不存在 orderPackageCode={} fromWarehouseId={}",orderPackageCode,fromWarehouseId);
return R.fail(405,"包件信息不存在");
}
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, fromWarehouseId);
if(Objects.isNull(parcelListEntity)){
log.warn("##############unloadPackage: 包件信息不存在 orderPackageCode={} fromWarehouseId={}",orderPackageCode,fromWarehouseId);
return R.fail(405,"包件信息不存在");
}
Long currentOrderId = null;
//查询当前仓库订单信息有没有
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(stockArticleEntity)){
//查询包件前面仓的订单信息
DistributionStockArticleEntity articleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
stockArticleEntity = new DistributionStockArticleEntity();
BeanUtil.copy(articleEntity,stockArticleEntity);
stockArticleEntity.setId(null);
stockArticleEntity.setWarehouseId(warehouseId);
stockArticleEntity.setWarehouse(warehouseName);
stockArticleEntity.setHandQuantity(0);
stockArticleEntity.setCompleteSet(1);
stockArticleEntity.setStockupStatus("10");
stockArticleEntity.setReservationStatus("10");
stockArticleEntity.setOrderStatus("10");
stockArticleEntity.setGroundingStatus("10");
stockArticleEntity.setOrderReceiveStatus("10");
stockArticleEntity.setFreezeStatus("10");
stockArticleEntity.setSortingQuantity(0);
stockArticleEntity.setDeliveryQuantity(0);
stockArticleEntity.setTransferQuantity(0);
stockArticleEntity.setSigninQuantity(0);
stockArticleEntity.setIncomingNum(0);
currentOrderId = distributionStockArticleClient.addData(stockArticleEntity);
stockArticleEntity.setId(currentOrderId);
}else{
currentOrderId = stockArticleEntity.getId();
}
Long currentOrderId = null;
//查询当前仓库订单信息有没有
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(stockArticleEntity)){
//查询包件前面仓的订单信息
DistributionStockArticleEntity articleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
stockArticleEntity = new DistributionStockArticleEntity();
BeanUtil.copy(articleEntity,stockArticleEntity);
stockArticleEntity.setId(null);
stockArticleEntity.setWarehouseId(warehouseId);
stockArticleEntity.setWarehouse(warehouseName);
stockArticleEntity.setHandQuantity(0);
stockArticleEntity.setCompleteSet(1);
stockArticleEntity.setStockupStatus("10");
stockArticleEntity.setReservationStatus("10");
stockArticleEntity.setOrderStatus("10");
stockArticleEntity.setGroundingStatus("10");
stockArticleEntity.setOrderReceiveStatus("10");
stockArticleEntity.setFreezeStatus("10");
stockArticleEntity.setSortingQuantity(0);
stockArticleEntity.setDeliveryQuantity(0);
stockArticleEntity.setTransferQuantity(0);
stockArticleEntity.setSigninQuantity(0);
stockArticleEntity.setIncomingNum(0);
currentOrderId = distributionStockArticleClient.addData(stockArticleEntity);
stockArticleEntity.setId(currentOrderId);
}else{
currentOrderId = stockArticleEntity.getId();
}
//判断包件当前仓是否是目的仓
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
//判断包件当前仓是否是目的仓
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(Objects.isNull(distributionParcelListEntity)){
distributionParcelListEntity = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity,distributionParcelListEntity);
distributionParcelListEntity.setId(null);
distributionParcelListEntity.setOrderPackageStatus("30");
if(!Objects.isNull(warehouseWaybillEntity)){
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if(destinationWarehouseId.equals(warehouseId)){
distributionParcelListEntity.setOrderPackageStatus("20");
if(Objects.isNull(distributionParcelListEntity)){
distributionParcelListEntity = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity,distributionParcelListEntity);
distributionParcelListEntity.setId(null);
distributionParcelListEntity.setOrderPackageStatus("30");
if(!Objects.isNull(warehouseWaybillEntity)){
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if(destinationWarehouseId.equals(warehouseId)){
distributionParcelListEntity.setOrderPackageStatus("20");
}
}
}
distributionParcelListEntity.setWarehouseId(warehouseId);
distributionParcelListEntity.setWarehouse(warehouseName);
distributionParcelListEntity.setTrainNumber(loadCode);
distributionParcelListEntity.setStockArticleId(currentOrderId);
distributionParcelListEntity.setOrderPackageFreezeStatus("10");
distributionParcelListEntity.setOrderPackageGroundingStatus("10");
distributionParcelListEntity.setOrderPackageStockupStatus("10");
distributionParcelListEntity.setOrderPackageReservationStatus("10");
distributionParcelListEntity.setOrderPackageLoadingStatus("10");
distributionParcelListEntity.setWarehouseEntryTimeEnd(new Date());
boolean add = distributionParcelListClient.add(distributionParcelListEntity);
if(add){
distributionStockArticleClient.addIncomingNum(currentOrderId,1);
}
}else{
Long packageId = distributionParcelListEntity.getId();
String packageStatus = "30";
if(!Objects.isNull(warehouseWaybillEntity)){
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if(destinationWarehouseId.equals(warehouseId)){
packageStatus = "20";
distributionParcelListEntity.setWarehouseId(warehouseId);
distributionParcelListEntity.setWarehouse(warehouseName);
distributionParcelListEntity.setTrainNumber(loadCode);
distributionParcelListEntity.setStockArticleId(currentOrderId);
distributionParcelListEntity.setOrderPackageFreezeStatus("10");
distributionParcelListEntity.setOrderPackageGroundingStatus("10");
distributionParcelListEntity.setOrderPackageStockupStatus("10");
distributionParcelListEntity.setOrderPackageReservationStatus("10");
distributionParcelListEntity.setOrderPackageLoadingStatus("10");
distributionParcelListEntity.setWarehouseEntryTimeEnd(new Date());
boolean add = distributionParcelListClient.add(distributionParcelListEntity);
if(add){
distributionStockArticleClient.addIncomingNum(currentOrderId,1);
}
}else{
Long packageId = distributionParcelListEntity.getId();
String packageStatus = "30";
if(!Objects.isNull(warehouseWaybillEntity)){
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if(destinationWarehouseId.equals(warehouseId)){
packageStatus = "20";
}
}
distributionParcelListClient.updateOrderPackageCodeById(packageId,packageStatus);
}
distributionParcelListClient.updateOrderPackageCodeById(packageId,packageStatus);
}
}
updateNumByLoadId(loadId);

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

@ -116,7 +116,7 @@
`third_product` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '三级品',
`market_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商场名称(库存品)',
`incoming_batch` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次号(库存品)',
`material_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物料名称(库存品)',
`material_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物料名称(库存品)',
`waybill_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '运单号',
`send_warehouse_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发站仓名称',
`tray_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '托盘名称',

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

@ -2127,12 +2127,12 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
@Override
public void downPackageByOrderPackageCode(String orderPackageCode,String remark,Long warehouseId) {
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsQueryWrapper = new QueryWrapper<>();
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCode(orderPackageCode);
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode,warehouseId);
trayGoodsQueryWrapper.eq("association_type","3")
.eq("association_value",orderPackageCode);
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(trayGoodsQueryWrapper);
StringBuffer stringBuffer = new StringBuffer();
if (Func.isNotEmpty(trayGoodsEntity)){
if (!Objects.isNull(trayGoodsEntity)){
Long trayGoodsId = trayGoodsEntity.getId();
Long trayTypeId = trayGoodsEntity.getTrayTypeId();
Long trayId = trayGoodsEntity.getTrayId();

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

@ -1370,7 +1370,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getOne(trayGoodsEntityQueryWrapper);
if(!Objects.isNull(warehouseTrayGoodsEntity)){
//有托盘,托盘下托
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,"包件下架:同步下托",warehouseId);
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,"包件托",warehouseId);
}
continue;
}

Loading…
Cancel
Save