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. 78
      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. 64
      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. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  39. 138
      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. 30
      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);
}

78
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,
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 warehouseEntryTime,
dsa.storage_fee storageFee,
dsa.total_number totalNumber,
dbl.certificate_type certificateType,
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 typeService,
dbl.pick_up_time pickUpTime,
dsa.type_service AS typeService,
dbl.pick_up_time AS pickUpTime,
dbl.consignee,
dbl.delivery_document deliveryDocument,
dbl.delivery_document AS 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
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

64
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;
@ -2196,19 +2197,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionAppDeliveryListVO> selectDistributionAppDeliveryListPage(IPage<DistributionAppDeliveryListVO> page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {
List<DistributionAppDeliveryListVO> distributionAppDeliveryListVOS = new ArrayList<>();
try {
//获取当前登录人
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();
// R<String> value = dictBizClient.getValue("role_class", roleId);
if (delivery) {
//查询当前登录人的配送任务
@ -2227,6 +2226,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else {
distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, null, myCurrentWarehouse.getId());
}
log.info(">>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}", distributionAppDeliveryListVOS);
//转换字典字段
for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) {
@ -2257,7 +2258,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//查询包件签收件数
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();
//维护计划数
@ -2267,7 +2267,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
int invertoryNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum();
distributionAppDeliveryListVO.setDeliveryNumber(packageNum + invertoryNum);
} else {
return null;
continue;
}
distributionAppDeliveryListVO.setSignNub(lad + nad);
//查询完成客户数
@ -2343,7 +2343,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionAppDeliveryListVO.setDriverName(stringBuilder.toString());
}
}
} catch (Exception e) {
log.error(">>>>>>>> 司机配送装车查询 报错", e);
}
return page.setRecords(distributionAppDeliveryListVOS);
}
@Override
@ -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) {

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

31
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,9 +1189,8 @@ 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);
List<DistributionStockupStockListVO> list = distributionReservationService.selectStockupStockList(reservationId,myCurrentWarehouse.getId(),mallName);
for (DistributionStockupStockListVO distributionStockupStockListVO : list) {
if (distributionStockupStockListVO.getPlanNum().equals(distributionStockupStockListVO.getRealNum())) {
distributionStockupStockListVO.setCompleteStact(true);
}

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

@ -21,6 +21,7 @@ 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.LambdaUpdateWrapper;
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.StringUtils;
@ -101,6 +102,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
private final IDistributionBillLadingScanService distributionBillLadingScanService;
private final IDistrilbutionBillStockService distrilbutionBillStockService;
private final IDistributionStockupScanService distributionStockupScanService;
@ -197,6 +200,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
}
//判断有没有库存品数据
private void updateStockBill(DistrilbutionBillLadingDTO distrilbutionBillLading) {
List<DistributionDeliveryDetailsEntity> list = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
@ -246,9 +250,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
/**
* 提货单 新增或修改
*
* @param distrilbutionBillLading
* @return
*/
@ -622,8 +626,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Override
public boolean signImages(DistrilbutionBillLadingDTO distrilbutionBillLading) {
//修改图片
List<DistributionPrintEntity> printEntityList = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda().eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLading.getId()));
if (!printEntityList.isEmpty()) {
@ -645,8 +647,114 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return false;
}
@Override
public R cancelBillLoding(String billLodingIds) {
String method = "##########类DistrilbutionBillLadingServiceImpl执行方法cancelBillLoding,";
List<Long> ids = Func.toLongList(",", billLodingIds);
List<DistrilbutionBillLadingEntity> distrilbutionBillLadingEntities = this.listByIds(ids);
if (Func.isEmpty(distrilbutionBillLadingEntities)) {
log.error(method + "查询自提单信息失败:{}", billLodingIds);
return R.fail("服务器正忙,请联系管理员!!!");
}
String errorBillLading = distrilbutionBillLadingEntities.stream().filter(f -> !f.getConditions().equals(BillLadingStatusConstant.daitihuo.getValue())).map(DistrilbutionBillLadingEntity::getPickupBatch).collect(Collectors.joining(","));
if (Func.isNotEmpty(errorBillLading)) {
log.error(method + "存在已提货或签收自提单:{}", errorBillLading);
return R.fail(errorBillLading + "已提货或已签收!!!");
}
//查询是否存在自提扫描的有效包件
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.in(DistributionBillLadingScanEntity::getBillLadingId, ids)
);
if (Func.isNotEmpty(ladingScanEntities)) {
log.error(method + "取消自提单存在自提扫描数据:{}", errorBillLading);
return R.fail(errorBillLading + "已提货或已签收!!!");
}
//满足进行取消自提,进行自提单的资源释放
//直接对配送的包件和库存品进行取消
Integer a = this.cancelBillLodingPackage(ids);
switch (a) {
case 0:
//进行自提单的取消
this.removeBatchByIds(ids);
return R.status(true);
case 1:
return R.fail("未授权!!!");
case 2:
return R.fail("存在签收包件");
}
return R.status(false);
}
@Transactional
private Integer cancelBillLodingPackage(List<Long> ids) {
String method = "##########类DistrilbutionBillLadingServiceImpl执行方法cancelBillLoding,";
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
//未授权
return 1;
}
//查询关联包件进行状态恢复
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectBillLadingPackage(ids);
if (Func.isNotEmpty(distributionParcelListEntities)) {
List<DistributionParcelListEntity> signingPakcage = distributionParcelListEntities.stream().filter(f -> f.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).collect(Collectors.toList());
if (Func.isNotEmpty(signingPakcage)) {
//存在签收包件
return 2;
}
//取消包件
UpdateWrapper<DistrilbutionBillPackageEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.in(DistrilbutionBillPackageEntity::getBillLadingId,ids)
.set(DistrilbutionBillPackageEntity::getPacketBarStatus,"3")
;
distrilbutionBillPackageService.update(updateWrapper);
//取消订单
UpdateWrapper<DistrilbutionBillStockEntity> orderUpdateWrapper = new UpdateWrapper<>();
orderUpdateWrapper.lambda()
.in(DistrilbutionBillStockEntity::getBillLadingId,ids)
.set(DistrilbutionBillStockEntity::getOrderStatus,"3")
;
distrilbutionBillStockService.update(orderUpdateWrapper);
List<Long> packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
//将这些包件还原成可操作状态
Integer num = distributionParcelListService.restorePakcageByIds(packageIds);
//维护订单状态
String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCodes, myCurrentWarehouse.getId());
}
//取消库存品
//查询自提库存品信息
List<DistributionDeliveryDetailsEntity> distributionStockListEntities = baseMapper.selectBillLadingInventory(ids);
if (Func.isNotEmpty(distributionStockListEntities)) {
//已经备货的库存品 存在库存品包件
distributionStockListEntities.forEach(ddd -> {
//恢复库存品数量
distributionStockListService.updateInventoryQuantityOccupied(ddd.getStockListId(),ddd.getQuantity());
//进行库存品包件取消
if (ddd.getStockStatus().equals("3")) {
disStockListDetailService.cancelInventoryPackageByReservationIdAnStockListId(ddd.getStockListId(), ddd.getBillLadingId());
}
}
);
//对所有的库存品相关进行取消标识
UpdateWrapper<DistributionDeliveryDetailsEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.set(DistributionDeliveryDetailsEntity::getInventoryStatus, 3)
.set(DistributionDeliveryDetailsEntity::getQuantity, 0)
.in(DistributionDeliveryDetailsEntity::getBillLadingId, ids);
distributionDeliveryDetailsService.update(updateWrapper);
}
return 0;
}
/**
* 自提没有包件信息添加包件
*
* @param stockArticleId
* @param billId
* @param parcelLisList
@ -696,9 +804,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
/**
* 添加提货包件数据
*
* @return
*/
public Boolean updateBillPackeg(DistrilbutionBillLadingDTO distrilbutionBillLading) {
@ -767,9 +875,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
/**
* 修改零担
*
* @param distrilbutionBillLadingDTO
* @return
*/
@ -837,7 +945,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
zeroPackageEntity.setRealityQuantity(0);
packageEntityList.add(zeroPackageEntity);
});
if(!packageEntityList.isEmpty()){ distributionZeroPackageService.saveBatch(packageEntityList); }
if (!packageEntityList.isEmpty()) {
distributionZeroPackageService.saveBatch(packageEntityList);
}
} else {
log.warn("没有品类数据");
@ -848,8 +958,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
/**
* 修改操作订单数据
*
@ -1868,6 +1976,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
return true;
}
/**
* 处理提货库存品签收
*/
@ -1893,15 +2002,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
}
}
/**
* 修改包件签收状态
*/
@ -1955,7 +2061,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
});
// if(!scanEntityList.isEmpty()){
// distributionBillLadingScanService.saveBatch(scanEntityList);
// }
@ -1964,8 +2069,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
@Override
public DistrilbutionBillLadingVO listNum(Map<String, Object> distrilbutionBillLading) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
@ -2133,6 +2236,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/**
* 零担的包件物料数据查询
*
* @param billLadingAppDTO
* @return
*/
@ -2170,6 +2274,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/**
* 零担批量签收
*
* @param billLadingAppDTO
* @return
*/
@ -2256,6 +2361,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/**
* 查询订单信息
*
* @param billLadingAppDTO
* @return
*/
@ -2297,6 +2403,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/**
* 零担单个签收
*
* @param billLadingAppDTO
* @return
*/
@ -2385,6 +2492,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/**
* 添加自提图片
*
* @param billLadingAppDTO
* @return
*/
@ -2438,6 +2546,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/**
* 查询自提签收图片
*
* @param billLadingAppDTO
* @return
*/
@ -2472,6 +2581,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/**
* 修改订单状态
*
* @return
*/
public Boolean updateStockArticle(Integer sum, Long stockArticleId) {

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);
}
}

30
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,7 +3693,7 @@ 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);
@ -3749,6 +3770,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionParcelListClient.updateOrderPackageCodeById(packageId,packageStatus);
}
}
}
updateNumByLoadId(loadId);
return R.success("卸车成功");

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