Browse Source

异常绑定回库任务

dist.1.3.0
汤建军 7 months ago
parent
commit
625a149909
  1. 3
      blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalTypeConstant.java
  2. 1
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDrivermiddleClient.java
  3. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanAbnormalEntity.java
  4. 11
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  5. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionLoadscanAbnormalClient.java
  6. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewReservationVO.java
  7. 7
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java
  8. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseRetentionScanClient.java
  9. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  10. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java
  11. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  12. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionCancelReservationPackageDTO.java
  13. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  14. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionLoadscanAbnormalClient.java
  15. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java
  16. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml
  17. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  18. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  19. 28
      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/DistributionStockArticleMapper.xml
  21. 29
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  22. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  23. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationZeroPackageService.java
  24. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  25. 349
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  26. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  27. 57
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java
  28. 140
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  29. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseRetentionScanClient.java
  30. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.java
  31. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionScanService.java
  32. 32
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java
  33. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java

3
blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalTypeConstant.java

@ -9,7 +9,8 @@ public enum LoadingAbnormalTypeConstant {
zhuangcheyichang("装车异常",1), zhuangcheyichang("装车异常",1),
jihuayichang("计划异常",2), jihuayichang("计划异常",2),
qianshouyichang("签收异常",3); qianshouyichang("签收异常",3),
yichangjuqian("异常拒签",4);
/** /**

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

@ -47,5 +47,6 @@ public interface IBasicdataDrivermiddleClient {
@GetMapping(TOP) @GetMapping(TOP)
BladePage<BasicdataDrivermiddleEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); BladePage<BasicdataDrivermiddleEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(TOP+"findDriverIdByCarId")
Long findDriverIdByCarId(Long carId); Long findDriverIdByCarId(Long carId);
} }

7
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanAbnormalEntity.java

@ -158,6 +158,13 @@ public class DistributionLoadscanAbnormalEntity extends TenantEntity {
*/ */
@ApiModelProperty(value = "货物类型 1-订制品 2-零担 3-库存品") @ApiModelProperty(value = "货物类型 1-订制品 2-零担 3-库存品")
private Integer goodsType; private Integer goodsType;
/**
* 是否完成 0否 1是
*/
@ApiModelProperty(value = "货物类型 1-订制品 2-零担 3-库存品")
private Integer complete;
/** /**
* 预留1 * 预留1
*/ */

11
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java

@ -134,6 +134,17 @@ public interface IDistributionDeliveryListClient {
@GetMapping(TOP+"/mallClientSignfor") @GetMapping(TOP+"/mallClientSignfor")
void mallClientSignfor(@RequestParam("tenantId") String tenantId,@RequestParam("trainNumber")String trainNumber,@RequestParam("warehouseId")Long warehouseId,@RequestParam("orderPackageCode")String orderPackageCode,@RequestParam("nowTenantId")String nowTenantId); void mallClientSignfor(@RequestParam("tenantId") String tenantId,@RequestParam("trainNumber")String trainNumber,@RequestParam("warehouseId")Long warehouseId,@RequestParam("orderPackageCode")String orderPackageCode,@RequestParam("nowTenantId")String nowTenantId);
/**
* 取消指定数量的零担
* @param deliveryId
* @param reservationId
* @param orderPackageId
* @param retentionQuantity
* @param orderId
* @return
*/
@GetMapping(TOP+"/retentionReservationZeroPackageByNum")
boolean retentionReservationZeroPackageByNum(@RequestParam("deliveryId")Long deliveryId,@RequestParam("reservationId") Long reservationId,@RequestParam("orderPackageId") Long orderPackageId,@RequestParam("retentionQuantity") Integer retentionQuantity,@RequestParam("orderId") Long orderId);
// /** // /**

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionLoadscanAbnormalClient.java

@ -46,4 +46,6 @@ public interface IDistributionLoadscanAbnormalClient {
@GetMapping(TOP) @GetMapping(TOP)
BladePage<DistributionLoadscanAbnormalEntity> loadscanAbnormalTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); BladePage<DistributionLoadscanAbnormalEntity> loadscanAbnormalTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(TOP+"completeAbnormal")
void completeAbnormal(Long abnormalId);
} }

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewReservationVO.java

@ -27,6 +27,7 @@ import lombok.EqualsAndHashCode;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 预约列表 App视图实体类 * 预约列表 App视图实体类
@ -56,6 +57,7 @@ public class DistributionAppNewReservationVO implements Serializable {
private List<DistributionAppStockArticleVO> orderList = new ArrayList<>(); private List<DistributionAppStockArticleVO> orderList = new ArrayList<>();
private List<DistributionAppStockArticleVO> zeroOrderList = new ArrayList<>(); private List<DistributionAppStockArticleVO> zeroOrderList = new ArrayList<>();
private List<DisStockListDetailVO> inventoryList = new ArrayList<>(); private List<DisStockListDetailVO> inventoryList = new ArrayList<>();
private List<Map<String,Object>> trayList = new ArrayList<>();
} }

7
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java

@ -291,4 +291,11 @@ public class WarehouseRetentionScanEntity extends TenantEntity {
@ApiModelProperty(value = "回库任务编号") @ApiModelProperty(value = "回库任务编号")
private String taskCode; private String taskCode;
/**
* 异常ID
*/
@ApiModelProperty(value = "异常ID")
private Long abnormalId;
} }

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseRetentionScanClient.java

@ -71,4 +71,7 @@ public interface IWarehouseRetentionScanClient {
@GetMapping(TOP+"/retentionScanEntityListByWarehouseId") @GetMapping(TOP+"/retentionScanEntityListByWarehouseId")
List<DistributionRetentionScanVO> getRetentionScanEntityListByWarehouseId(@RequestParam("warehouseId") Long warehouseId,@RequestParam("taskTimeStart")String taskTimeStart,@RequestParam("taskTimeEnd")String taskTimeEnd); List<DistributionRetentionScanVO> getRetentionScanEntityListByWarehouseId(@RequestParam("warehouseId") Long warehouseId,@RequestParam("taskTimeStart")String taskTimeStart,@RequestParam("taskTimeEnd")String taskTimeEnd);
@GetMapping(TOP+"/judgeIsHaveRetention")
boolean judgeIsHaveRetention(String orderPackageCode, Long id);
} }

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java

@ -132,6 +132,18 @@ public class DistributionDeliveryAppController {
return R.data(pages); return R.data(pages);
} }
/**
* 配送 查看客户
*/
@GetMapping("/newTrays")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO")
public R newTrays(DistributionAppDeliveryListDTO distributionDeliveryList) {
R r= distributionDeliveryListService.getAppDeliveryreservationNewTrays(distributionDeliveryList);
return r;
}
/** /**
* 配送 查看订单 * 配送 查看订单
*/ */
@ -390,7 +402,19 @@ public class DistributionDeliveryAppController {
public R createdRetention(String barcode) { public R createdRetention(String barcode) {
R r = distributionDeliveryListService.createdRetentionEntity(barcode); R r = distributionDeliveryListService.createdRetentionEntity(barcode);
return r; return r;
}
}
/**
* 扫描查询配送任务下的包件信息
*/
@GetMapping("/createdZeroRetention")
@ApiOperationSupport(order = 11)
public R createdZeroRetention(String barcode) {
R r = distributionDeliveryListService.createdZeroRetention(barcode);
return r;
}
/** /**

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java

@ -207,11 +207,26 @@ public class DistributionSignforAppController {
@PostMapping("/newSignfor") @PostMapping("/newSignfor")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
public R newSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) { public R newSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
try { try {
R r = distributionSignforService.newSignfor(distrilbutionloadingscanDTO); R r = distributionSignforService.newSignfor(distrilbutionloadingscanDTO);
return r; return r;
} catch (Exception e) {
log.error("#############signfor:签收报错", e);
}
return R.fail("签收失败!");
}
/**
* 取消异常签收
* @param distrilbutionloadingscanDTO
* @return
*/
@PostMapping("/newCancelAbnormalSignfor")
@ApiOperationSupport(order = 2)
public R newCancelAbnormalSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
try {
R r = distributionSignforService.newCancelAbnormalSignfor(distrilbutionloadingscanDTO);
return r;
} catch (Exception e) { } catch (Exception e) {
log.error("#############signfor:签收报错", e); log.error("#############signfor:签收报错", e);
} }

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

@ -399,8 +399,8 @@ public class DistributionDeliveryListController extends BladeController {
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "customArgs") @ApiOperation(value = "分页", notes = "customArgs")
public R getDeliveryZeroOrderDetail(@ApiIgnore @RequestParam Long deliveryId,@RequestParam Long orderId) { public R getDeliveryZeroOrderDetail(@ApiIgnore @RequestParam Long deliveryId,@RequestParam Long orderId) {
List<DistributionParcelNumberVO> parcelNumberVOS = distributionDeliveryListService.getDeliveryZeroOrderDetail(deliveryId, orderId); R r = distributionDeliveryListService.getDeliveryZeroOrderDetail(deliveryId, orderId);
return R.data(parcelNumberVOS); return r;
} }
/** /**
@ -578,7 +578,7 @@ public class DistributionDeliveryListController extends BladeController {
@PostMapping("/cancelLoadingAbnormal") @PostMapping("/cancelLoadingAbnormal")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO") @ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO")
public R cancelAbnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { public R cancelAbnormalLoading(@RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = null; R msg = null;
try { try {
msg= distributionDeliveryListService.cancelAbnormalLoading(distrilbutionloadingscanDTO); msg= distributionDeliveryListService.cancelAbnormalLoading(distrilbutionloadingscanDTO);

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

@ -66,6 +66,11 @@ public class DistributionCancelReservationPackageDTO {
*/ */
private String inventoryPackageIds; private String inventoryPackageIds;
/**
* 库存品包件ID
*/
private String num;

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java

@ -138,7 +138,10 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
distributionDeliveryListService.mallClientSignfor(trainNumber,warehouseId,orderPackageCode); distributionDeliveryListService.mallClientSignfor(trainNumber,warehouseId,orderPackageCode);
} }
@Override
public boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId) {
return distributionDeliveryListService.retentionReservationZeroPackageByNum(deliveryId,reservationId,orderPackageId,retentionQuantity,orderId);
}
} }

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

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity; import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity;
import com.logpm.distribution.service.IDistributionLoadscanAbnormalService; import com.logpm.distribution.service.IDistributionLoadscanAbnormalService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -50,4 +51,13 @@ public class DistributionLoadscanAbnormalClient implements IDistributionLoadscan
return BladePage.of(page); return BladePage.of(page);
} }
@Override
public void completeAbnormal(Long abnormalId) {
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity();
distributionLoadscanAbnormalEntity.setId(abnormalId);
distributionLoadscanAbnormalEntity.setComplete(Integer.parseInt(IsOrNoConstant.yes.getValue()));
distributionLoadscanAbnormalService.updateById(distributionLoadscanAbnormalEntity);
}
} }

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

@ -107,5 +107,5 @@ public interface DistributionDeliverySelfMapper extends BaseMapper<DistributionD
* @param vehicleNub * @param vehicleNub
* @return * @return
*/ */
DistributionDeliverySelfEntity selectDriverInfoByDeliveryIdAndVehicleNub(@Param("driverId")Long driverId,@Param("vehicleNub") String vehicleNub); DistributionDeliverySelfEntity selectDriverInfoByDeliveryIdAndVehicleNub(@Param("deliveryId")Long deliveryId,@Param("vehicleNub") String vehicleNub);
} }

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

@ -95,7 +95,7 @@
</select> </select>
<select id="selectDriverInfoByDeliveryIdAndVehicleNub" <select id="selectDriverInfoByDeliveryIdAndVehicleNub"
resultType="com.logpm.distribution.entity.DistributionDeliverySelfEntity"> resultType="com.logpm.distribution.entity.DistributionDeliverySelfEntity">
SELECT * FROM logpm_distribution_delivery_self WHERE delivery_id = #{deliveryId} AND vehicle_nub = {#vehicleNub} AND is_deleted = 0 SELECT * FROM logpm_distribution_delivery_self WHERE delivery_id = #{deliveryId} AND vehicle_nub = #{vehicleNub} AND is_deleted = 0
</select> </select>
</mapper> </mapper>

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

@ -416,4 +416,17 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
List<DistributionStockArticleVO> selectOrderInfoByReservationIdAndOrderCode(@Param("param") DistributionAppDeliveryListDTO distributionAppDeliveryListDTO,@Param("isZero") int isZero); List<DistributionStockArticleVO> selectOrderInfoByReservationIdAndOrderCode(@Param("param") DistributionAppDeliveryListDTO distributionAppDeliveryListDTO,@Param("isZero") int isZero);
/**
* 查询客户下支持装车的托盘
* @param reservationId
* @return
*/
List<String> selectTrayInfoByReservationId(@Param("reservationId")Long reservationId);
/**
* 查询已装车托盘
* @param reservationId
* @return
*/
List<Map<String, Object>> selectLoadingTrayInfoByReservationId(@Param("reservationId")Long reservationId);
} }

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

@ -1969,4 +1969,35 @@
reservation_status!=40 reservation_status!=40
where lddl.id=#{id} where lddl.id=#{id}
</select> </select>
<select id="selectTrayInfoByReservationId" resultType="java.lang.String">
SELECT
GROUP_CONCAT(lwtga.goods_name) AS goodsNames
FROM
logpm_distribution_signfor AS lds
LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.association_id = ldrp.parce_list_id
JOIN logpm_warehouse_tray_goods AS lwtga ON lwtg.id = lwtga.id
WHERE lds.reservation_id = #{reservationId} and lwtg.association_type in ('3')
GROUP BY lwtg.tray_id,lds.reservation_id,lwtg.tray_code,lwtg.num,lwtg.association_type
</select>
<select id="selectLoadingTrayInfoByReservationId" resultType="java.util.Map">
SELECT
ldl.tray_no AS trayName,
'订制品' AS type,
IFNULL(sum(ldl.package_nub) ,0) AS trayNum,
lwt.pallet_code AS trayCode
FROM
logpm_distribution_loadscan AS ldl
LEFT JOIN logpm_warehouse_tray AS lwt ON ldl.tray_no = lwt.pallet_name AND ldl.warehouse_id = lwt.warehouse_id
WHERE
ldl.reservation_id = #{reservationId}
AND ldl.is_deleted = 0
AND ldl.scan_status != 1
AND lwt.is_deleted = 0
GROUP BY
ldl.tray_no
HAVING
ldl.tray_no is not null
</select>
</mapper> </mapper>

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

@ -2204,18 +2204,22 @@
ldla.id AS id, ldla.id AS id,
ldla.auditing_status AS auditingStatus, ldla.auditing_status AS auditingStatus,
CASE CASE
WHEN ldla.auditing_status = 1 THEN '待审核' ldla.auditing_status
WHEN ldla.auditing_status = 2 THEN '已审核' WHEN 1 THEN
WHEN ldla.auditing_status = 3 THEN '已驳回' '待审核'
WHEN ldla.auditing_status = 4 THEN '已取消' WHEN 2 THEN
ELSE '已审核'
'未知' WHEN 3 THEN
'已驳回'
WHEN 4 THEN
'已取消' ELSE '未知'
END AS auditingStatusName, END AS auditingStatusName,
CASE CASE
WHEN ldla.auditing_status = 1 THEN '未完成' ldla.complete
WHEN ldla.auditing_status != 1 THEN '已完成' WHEN 0 THEN
ELSE '未完成'
'未知' WHEN 1 THEN
'已完成' ELSE '未知'
END AS completeName, END AS completeName,
ldla.auditing_time AS auditingTime, ldla.auditing_time AS auditingTime,
ldla.auditing_user AS auditingUser, ldla.auditing_user AS auditingUser,
@ -2250,7 +2254,9 @@
WHEN 2 THEN WHEN 2 THEN
'计划异常' '计划异常'
WHEN 3 THEN WHEN 3 THEN
'签收异常' ELSE '未知' '签收异常'
WHEN 4 THEN
'异常拒签' ELSE '未知'
END abnormalTypeName END abnormalTypeName
FROM FROM
logpm_distribution_loadscan_abnormal AS ldla logpm_distribution_loadscan_abnormal AS ldla

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

@ -888,7 +888,7 @@
ldpl.brand_name AS brandName, ldpl.brand_name AS brandName,
ldpn.quantity AS quantity, ldpn.quantity AS quantity,
ldpn.hand_quantity AS handQuantity, ldpn.hand_quantity AS handQuantity,
ldpn.hand_quantity AS number, ldpn.quantity AS number,
ldpn.delivery_quantity AS deliveryQuantity, ldpn.delivery_quantity AS deliveryQuantity,
ldpn.outbound_quantity AS outboundQuantity, ldpn.outbound_quantity AS outboundQuantity,
ldpn.signin_quantity AS signinQuantity, ldpn.signin_quantity AS signinQuantity,

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

@ -26,6 +26,7 @@ import com.logpm.distribution.dto.DistributionDeliveryListDTO;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.entity.DistributionDeliveryListEntity; import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.entity.DistributionLoadscanEntity; import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.excel.DistributionDeliveryListExcel; import com.logpm.distribution.excel.DistributionDeliveryListExcel;
@ -304,7 +305,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param orderId * @param orderId
* @return * @return
*/ */
List<DistributionParcelNumberVO> getDeliveryZeroOrderDetail(Long deliveryId, Long orderId); R getDeliveryZeroOrderDetail(Long deliveryId, Long orderId);
/** /**
* 零担装车 * 零担装车
@ -415,6 +416,8 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/ */
IPage<DistributionDeliveryWordVO> getShippingInformation(IPage<Object> page, DistributionDeliveryListDTO distributionDeliveryInfoDTO); IPage<DistributionDeliveryWordVO> getShippingInformation(IPage<Object> page, DistributionDeliveryListDTO distributionDeliveryInfoDTO);
DistributionDeliverySelfEntity getDriver(DistributionDeliveryListEntity deliveryListEntity, BladeUser user, String vehicleNub, boolean isDriverFlag);
/** /**
* 维护配送任务信息 * 维护配送任务信息
* @param deliveryId * @param deliveryId
@ -540,6 +543,30 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
R cancelAbnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO); R cancelAbnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
* 查询托盘
* @param distributionDeliveryList
* @return
*/
R getAppDeliveryreservationNewTrays(DistributionAppDeliveryListDTO distributionDeliveryList);
/**
* 生成零担回库任务
* @param barcode
* @return
*/
R createdZeroRetention(String barcode);
/**
* 取消指定数量的零担
* @param deliveryId
* @param reservationId
* @param orderPackageId
* @param retentionQuantity
* @param orderId
* @return
*/
boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId);
// /** // /**

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

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionCancelReservationPackageDTO; import com.logpm.distribution.dto.DistributionCancelReservationPackageDTO;
import com.logpm.distribution.dto.DistributionDeliveryAllocationDTO; import com.logpm.distribution.dto.DistributionDeliveryAllocationDTO;
import com.logpm.distribution.dto.DistributionReservationDTO; import com.logpm.distribution.dto.DistributionReservationDTO;
import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity;
import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.excel.DistributionReservationExcel; import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.*;
@ -317,4 +318,11 @@ public interface IDistributionReservationService extends BaseService<Distributio
* @return * @return
*/ */
R batchCancelMallReservation(String ids); R batchCancelMallReservation(String ids);
/**
* 取消零担
* @param cancelZeroData
*/
void cancelReservationZeroPackage(List<DistributionLoadscanAbnormalEntity> cancelZeroData,Long warehouseId);
} }

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

@ -73,4 +73,19 @@ public interface IDistributionReservationZeroPackageService extends BaseService<
void recoverZeroPackage(Long reservationId, List<Long> collect); void recoverZeroPackage(Long reservationId, List<Long> collect);
/**
* 维护当前预约下零担状态
* @param reservationId
* @param packageId
*/
void maintainReservationZeroPackage(Long reservationId, Long packageId);
/**
* 减少零担配送数量
* @param reservationId
* @param orderId
* @param orderPackageId
* @param retentionQuantity
*/
void reduceNum(Long reservationId, Long orderId, Long orderPackageId, Integer retentionQuantity);
} }

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

@ -420,4 +420,12 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @param reservationId * @param reservationId
*/ */
void maintainIsHaveAbnormalPackage(Long reservationId); void maintainIsHaveAbnormalPackage(Long reservationId);
/**
* 取消异常签收
* @param distrilbutionloadingscanDTO
* @return
*/
R newCancelAbnormalSignfor(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO);
} }

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

@ -59,7 +59,6 @@ import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.*; import com.logpm.warehouse.feign.*;
import com.logpm.warehouse.vo.TrayTypeDataVO; import com.logpm.warehouse.vo.TrayTypeDataVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
@ -82,7 +81,6 @@ import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.constant.reservation.*; import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.retention.RetentionSourceTypeConstant; import org.springblade.common.constant.retention.RetentionSourceTypeConstant;
import org.springblade.common.constant.retention.RetentionTypeConstant;
import org.springblade.common.constant.signing.SignforStatusConstant; import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockAssignStatusConstant; import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.constant.stockup.StockupStatusConstant;
@ -1882,7 +1880,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//库存品 //库存品
DistributionDeliveryListEntity distributionDeliveryListEntity = this.getById(distrilbutionloadingscanDTO.getDeliveryId()); DistributionDeliveryListEntity distributionDeliveryListEntity = this.getById(distrilbutionloadingscanDTO.getDeliveryId());
//获取当前用户司机 //获取当前用户司机
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, AuthUtil.getUser(), distrilbutionloadingscanDTO, true); DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, AuthUtil.getUser(), distrilbutionloadingscanDTO.getVehicleNub(), true);
// DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId()); // DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
// DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity(); // DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
@ -2584,7 +2582,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(loadscanEntityList) && loadscanEntityList.size() > 0) { if (Func.isNotEmpty(loadscanEntityList) && loadscanEntityList.size() > 0) {
//此配送任务存在装车 无法进行司机切换 //此配送任务存在装车 无法进行司机切换
log.error("配送任务存在装车数据,无法进行司机切换"); log.error("配送任务存在装车数据,无法进行司机切换");
throw new CustomerException("任务已装车联系司机滞留货物后进行司机切换..."); throw new CustomerException("任务已装车联系司机将货物回库后进行司机切换...");
} }
} }
} }
@ -2913,17 +2911,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
orderTotal.getAndIncrement(); orderTotal.getAndIncrement();
//添加缓存 //添加缓存
if (!packageLockIds.isEmpty()) { if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode()); List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + ":orderCode:" + s.getOrderCode());
if (Func.isNotEmpty(a)) { if (Func.isNotEmpty(a)) {
boolean flag = a.stream().anyMatch(f -> packageLockIds.contains(f)); boolean flag = a.stream().anyMatch(f -> packageLockIds.contains(f));
if (flag) { if (flag) {
throw new RuntimeException(s.getOrderCode() + "正在操作,请刷新后尝试"); throw new RuntimeException(s.getOrderCode() + "正在操作,请刷新后尝试");
} else { } else {
packageLockIds.addAll(a); packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(), packageLockIds, 60L); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":orderCode:" + s.getOrderCode(), packageLockIds, 60L);
} }
} else { } else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(), packageLockIds, 60L); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":orderCode:" + s.getOrderCode(), packageLockIds, 60L);
} }
} }
}); });
@ -3362,14 +3360,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(), myCurrentWarehouse.getId()); distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(), myCurrentWarehouse.getId());
} }
if (!packageLockIds.isEmpty()) { if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode()); List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + ":orderCode:" + s.getOrderCode());
if (Func.isNotEmpty(a)) { if (Func.isNotEmpty(a)) {
boolean flag = a.stream().anyMatch(f -> packageLockIds.contains(f)); boolean flag = a.stream().anyMatch(f -> packageLockIds.contains(f));
if (flag) { if (flag) {
throw new RuntimeException(s.getOrderCode() + "正在操作,请刷新后尝试"); throw new RuntimeException(s.getOrderCode() + "正在操作,请刷新后尝试");
} else { } else {
packageLockIds.addAll(a); packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(), packageLockIds, 5 * 60L); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":orderCode:" + s.getOrderCode(), packageLockIds, 5 * 60L);
} }
} }
} }
@ -3427,7 +3425,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} }
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(n.get(0).getStockArticleId()); DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(n.get(0).getStockArticleId());
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), myCurrentWarehouse.getId()); distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), myCurrentWarehouse.getId());
bladeRedis.del("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + stockArticleEntity.getOrderCode()); bladeRedis.del("warehouseId:" + myCurrentWarehouse.getId() + ":orderCode:" + stockArticleEntity.getOrderCode());
}); });
} }
//重新维护预约信息 //重新维护预约信息
@ -4661,7 +4659,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("请勿重复发车", "请勿重复发车"); return Resp.scanFail("请勿重复发车", "请勿重复发车");
} }
if ("1".equals(distributionDeliveryListEntity.getKind())) { if ("1".equals(distributionDeliveryListEntity.getKind())) {
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO, isDriverFlag); DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO.getVehicleNub(), isDriverFlag);
distributionDeliverySelfEntity.setDepartureTime(format); distributionDeliverySelfEntity.setDepartureTime(format);
b = distributionDeliverySelfService.updateById(distributionDeliverySelfEntity); b = distributionDeliverySelfService.updateById(distributionDeliverySelfEntity);
isEnd = isEndDriver(distributionDeliveryListEntity.getId()); isEnd = isEndDriver(distributionDeliveryListEntity.getId());
@ -5919,14 +5917,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} }
@Override @Override
public List<DistributionParcelNumberVO> getDeliveryZeroOrderDetail(Long deliveryId, Long orderId) { public R getDeliveryZeroOrderDetail(Long deliveryId, Long orderId) {
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId) .eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
.eq(DistributionLoadscanEntity::getOrderId, orderId) .eq(DistributionLoadscanEntity::getOrderId, orderId)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
); );
if (!Func.isEmpty(loadscanEntityList)) { if (!Func.isEmpty(loadscanEntityList)) {
return null; return R.fail("当前零担已装车");
} }
List<DistributionParcelNumberVO> zeroOrderDetail = distributionStockArticleService.getZeroOrderDetail(orderId); List<DistributionParcelNumberVO> zeroOrderDetail = distributionStockArticleService.getZeroOrderDetail(orderId);
List<DistributionParcelNumberVO> parcelNumberVOS = baseMapper.selectDeliveryZeroOrderDetail(orderId, deliveryId); List<DistributionParcelNumberVO> parcelNumberVOS = baseMapper.selectDeliveryZeroOrderDetail(orderId, deliveryId);
@ -5940,7 +5938,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
int quantity = z.getHandQuantity() - z.getDeliveryQuantity() + integer; int quantity = z.getHandQuantity() - z.getDeliveryQuantity() + integer;
z.setNumber(quantity); z.setNumber(quantity);
}); });
return zeroOrderDetail; return R.data(zeroOrderDetail);
} }
@Override @Override
@ -6802,7 +6800,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (row == 1) { if (row == 1) {
//存在计划 //存在计划
//进行了一条包件任务的取消,此时就应该对预约、配送任务进行数量的维护 //进行了一条包件任务的取消,此时就应该对预约、配送任务进行数量的维护
distributionAsyncService.checkRetentionReservationAndDeliveryInfo(reservationId, deliveryId); distributionAsyncService.checkRetentionReservationAndDeliveryInfo(reservationId, deliveryId);
} }
@ -6810,37 +6807,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//包件未预约 处于异常驳回状态 //包件未预约 处于异常驳回状态
//查询异常信息,对异常信息进行清理 //查询异常信息,对异常信息进行清理
log.info("滞留查询审核列表信息:{}", row); log.info("滞留查询审核列表信息:{}", row);
DistributionLoadscanAbnormalEntity abnormalEntity = distributionLoadscanAbnormalService.getOne(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getPackageId, orderPackageId)
.eq(DistributionLoadscanAbnormalEntity::getDeliveryListId, deliveryId)
.eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, 3)
);
log.info("滞留查询审核列表信息:{}", abnormalEntity);
if (!Objects.isNull(abnormalEntity)) {
//清理异常信息
distributionLoadscanAbnormalService.removeById(abnormalEntity);
} else {
log.error(">>>>>>>>>>>>>>>查询异常信息错误:{}", orderPackageId);
}
//查询出多个包件信息 //查询出多个包件信息
if (Func.isNotEmpty(loadscanEntity)) { if (Func.isNotEmpty(loadscanEntity)) {
//修改包件状态 达到回库的状态 //修改包件状态 达到回库的状态
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(loadscanEntity.getPackageId()); DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(loadscanEntity.getPackageId());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
distributionParcelListService.updateById(parcelListEntity);
//已经进行装车 //已经进行装车
loadscanEntity.setScanStatus(LoadingStatusConstant.quxiao.getValue()); loadscanEntity.setScanStatus(LoadingStatusConstant.quxiao.getValue());
distributionLoadscanService.updateById(loadscanEntity); distributionLoadscanService.updateById(loadscanEntity);
// 对应签收信息的装车数量要进行扣减 // 对应签收信息的装车数量要进行扣减
int a = distributionSignforMapper.deductionLoadingPacjageNum(loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId(), loadscanEntity.getLoadedNub()); int a = distributionSignforMapper.deductionLoadingPacjageNum(loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId(), loadscanEntity.getLoadedNub());
//维护订单状态 //维护订单状态
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), parcelListEntity.getWarehouseId()); String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "取消配送,取消方式:异常驳回,配送车次号:" + loadscanEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
//增加滞留信息
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "取消配车,取消方式:滞留扫描,取消计划,配送车次号:" + loadscanEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode()); JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode());
aaa.add(js); aaa.add(js);
//对滞留包件进行签收信息数量减少 //对滞留包件进行签收信息数量减少
@ -8009,7 +7986,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!driver) { if (!driver) {
return Resp.scanFail("此按钮只能司机操作!", "此按钮只能司机操作!"); return Resp.scanFail("此按钮只能司机操作!", "此按钮只能司机操作!");
} }
DistributionDeliverySelfEntity deliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO, driver); DistributionDeliverySelfEntity deliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO.getVehicleNub(), driver);
if (Objects.isNull(deliverySelfEntity)) { if (Objects.isNull(deliverySelfEntity)) {
return Resp.scanFail("当前司机不属于该车次!", "当前司机不属于该车次!"); return Resp.scanFail("当前司机不属于该车次!", "当前司机不属于该车次!");
} }
@ -8632,17 +8609,23 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//日志信息收集 //日志信息收集
List<JSONObject> packageLogs = new ArrayList<>(); List<JSONObject> packageLogs = new ArrayList<>();
//查询司机信息 //查询司机信息
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryListEntity, user, distrilbutionloadingscanDTO, isDriverFlag); DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryListEntity, user, distrilbutionloadingscanDTO.getVehicleNub(), isDriverFlag);
if (Objects.isNull(distributionDeliverySelfEntity)) { if (Objects.isNull(distributionDeliverySelfEntity)) {
return Resp.fail("当前操作人不合法"); return Resp.fail("当前操作人不合法");
} }
switch (type) { switch (type) {
case 1: case 1:
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())) { if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())) {
log.error(method + "参数缺失Barcode"); log.error(method + "参数缺失Barcode");
return Resp.fail("参数缺失,请联系管理员"); return Resp.fail("参数缺失,请联系管理员");
} }
String orderPackageCode = distrilbutionloadingscanDTO.getBarcode(); String orderPackageCode = distrilbutionloadingscanDTO.getBarcode();
//校验当前包件是否存在回库任务
boolean isHaveRetention = retentionScanClient.judgeIsHaveRetention(orderPackageCode,myCurrentWarehouse.getId());
if (isHaveRetention){
return Resp.scanFail("当前包件存在回库任务","当前包件存在回库任务");
}
DistributionParcelListEntity parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(orderPackageCode, myCurrentWarehouse.getId()); DistributionParcelListEntity parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(orderPackageCode, myCurrentWarehouse.getId());
if (Objects.isNull(parcelListEntity)) { if (Objects.isNull(parcelListEntity)) {
//查询是否为库存品 //查询是否为库存品
@ -8667,6 +8650,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!loadscanEntityList.isEmpty()) { if (!loadscanEntityList.isEmpty()) {
return Resp.scanFail("此包件已装车", "此包件已装车"); return Resp.scanFail("此包件已装车", "此包件已装车");
} }
//查询是否满足计划 以及计划在哪个客户中 //查询是否满足计划 以及计划在哪个客户中
Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode, deliveryId, warehouseId); Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode, deliveryId, warehouseId);
if (Objects.isNull(reservationId)) { if (Objects.isNull(reservationId)) {
@ -8678,6 +8662,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Boolean isAbnormalLoadingFlag = judgeIsAbnormalLoading(deliveryId, parcelListEntity, reservationId); Boolean isAbnormalLoadingFlag = judgeIsAbnormalLoading(deliveryId, parcelListEntity, reservationId);
if (isAbnormalLoadingFlag) { if (isAbnormalLoadingFlag) {
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId()); log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId());
//已发车无法进行异常装车
if (DeliveryStartStatusConstant.yifache.equals(deliveryListEntity.getIsStart())){
return Resp.scanFail("已发车无法进行异常装车", "已发车无法进行异常装车");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())) { if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())) {
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车"); return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
} }
@ -8783,6 +8771,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (parcelListDTO.getLoadingNum() <= reservationZeroPackageEntity.getQuantity()) { if (parcelListDTO.getLoadingNum() <= reservationZeroPackageEntity.getQuantity()) {
//零担修改装车 //零担修改装车
DistributionLoadscanEntity zeroLoadscanEntity = loadscanEntities.get(0); DistributionLoadscanEntity zeroLoadscanEntity = loadscanEntities.get(0);
if (!distributionDeliverySelfEntity.getVehicleNub().equals(zeroLoadscanEntity.getVehicleName())) {
//零担装车只能在一个车上
return Resp.scanFail("零担同一品类需在一个车", "零担同一品类需在一个车");
}
updateZeroLoadingEntity(zeroLoadscanEntity, parcelListDTO, myCurrentWarehouse, zeroPackageMap); updateZeroLoadingEntity(zeroLoadscanEntity, parcelListDTO, myCurrentWarehouse, zeroPackageMap);
JSONObject zeroJsonObject = new JSONObject(); JSONObject zeroJsonObject = new JSONObject();
zeroJsonObject.put("code", zeroParcelListEntity.getOrderCode()); zeroJsonObject.put("code", zeroParcelListEntity.getOrderCode());
@ -9133,9 +9125,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getOrderPackageCode, barcode) .eq(DistributionLoadscanEntity::getOrderPackageCode, barcode)
.eq(DistributionLoadscanEntity::getWarehouseId, myCurrentWarehouse.getId()) .eq(DistributionLoadscanEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
); );
if (!Objects.isNull(loadscanEntityList)) { if (!loadscanEntityList.isEmpty()) {
//校验是否重复扫描 //校验是否重复扫描
boolean isRepeatFlag = loadscanEntityList.stream().anyMatch(f -> reservationId.equals(f.getReservationId())); boolean isRepeatFlag = loadscanEntityList.stream().anyMatch(f -> reservationId.equals(f.getReservationId()));
if (isRepeatFlag) { if (isRepeatFlag) {
@ -9144,7 +9136,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else { } else {
//校验是否在其他车次存在异常 //校验是否在其他车次存在异常
String abnormalTrainNumber = loadscanEntityList.stream().map(DistributionLoadscanEntity::getTrainNumber).distinct().collect(Collectors.joining(",")); String abnormalTrainNumber = loadscanEntityList.stream().map(DistributionLoadscanEntity::getTrainNumber).distinct().collect(Collectors.joining(","));
return Resp.scanFail("此包件在" + abnormalTrainNumber + "存在异常操作", "此包件" + abnormalTrainNumber + "存在异常操作"); return Resp.scanFail("此包件在" + abnormalTrainNumber + "存在异常操作", "此包件" + abnormalTrainNumber + "存在异常操作");
} }
} }
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
@ -9153,8 +9145,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<String> orderPackageCodes = new ArrayList<>(); List<String> orderPackageCodes = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>(); List<JSONObject> aaa = new ArrayList<>();
//查询当前司机信息 //查询当前司机信息
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryList, user, distrilbutionloadingscanDTO, isDriverFlag); DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryList, user, distrilbutionloadingscanDTO.getVehicleNub(), isDriverFlag);
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
DistributionReservationEntity reservationEntity = null; DistributionReservationEntity reservationEntity = null;
switch (deliveryList.getType()) { switch (deliveryList.getType()) {
case "1": case "1":
@ -9188,6 +9179,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} }
DistributionLoadscanEntity distributionLoadscanEntity = createdDistributionLoadscanEntity(deliveryList, distributionDeliverySelfEntity, reservationId, parcelListEntity, myCurrentWarehouse, user); DistributionLoadscanEntity distributionLoadscanEntity = createdDistributionLoadscanEntity(deliveryList, distributionDeliverySelfEntity, reservationId, parcelListEntity, myCurrentWarehouse, user);
distributionLoadscanEntity.setIsAbnormalLoading(1); distributionLoadscanEntity.setIsAbnormalLoading(1);
distributionLoadscanService.save(distributionLoadscanEntity);
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity(); DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity();
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue()); distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue());
distributionLoadscanAbnormalEntity.setStockArticleId(parcelListEntity.getStockArticleId()); distributionLoadscanAbnormalEntity.setStockArticleId(parcelListEntity.getStockArticleId());
@ -9208,17 +9200,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscanAbnormalEntity.setLoadingId(distributionLoadscanEntity.getId()); distributionLoadscanAbnormalEntity.setLoadingId(distributionLoadscanEntity.getId());
distributionLoadscanAbnormalEntity.setGoodsType(1); distributionLoadscanAbnormalEntity.setGoodsType(1);
distributionLoadscanAbnormalEntity.setAbnormalType(LoadingAbnormalTypeConstant.jihuayichang.getValue()); distributionLoadscanAbnormalEntity.setAbnormalType(LoadingAbnormalTypeConstant.jihuayichang.getValue());
orderPackageCodes.add(loadscanEntity.getOrderPackageCode()); orderPackageCodes.add(distributionLoadscanEntity.getOrderPackageCode());
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity);
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "扫描异常装车,配送车次号:" + deliveryList.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getScanUser() + "扫描异常装车,配送车次号:" + deliveryList.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_LOADING.getCode()); JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_LOADING.getCode());
aaa.add(trunklinePackageTrackLog); aaa.add(trunklinePackageTrackLog);
List<JSONObject> jsonObjects = new ArrayList<>(); List<JSONObject> jsonObjects = new ArrayList<>();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("code", loadscanEntity.getOrderPackageCode()); jsonObject.put("code", distributionLoadscanEntity.getOrderPackageCode());
jsonObject.put("warehouseId", myCurrentWarehouse.getId()); jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("taskId", loadscanEntity.getReservationId()); jsonObject.put("taskId", distributionLoadscanEntity.getReservationId());
jsonObject.put("type", 1); jsonObject.put("type", 1);
jsonObject.put("num", 1); jsonObject.put("num", 1);
jsonObject.put("remark", "异常装车下架"); jsonObject.put("remark", "异常装车下架");
@ -9237,10 +9229,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询本车次是否第一次扫码,没有则更新上车时间 //查询本车次是否第一次扫码,没有则更新上车时间
distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量 //更新签收表的装车数量
distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//维护订单信息 //维护订单信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId()); distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId());
packageLockIds.add(loadscanEntity.getPackageId()); packageLockIds.add(distributionLoadscanEntity.getPackageId());
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda() DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()) .eq(DistributionSignforEntity::getReservationId, reservationEntity.getId())
.eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())); .eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
@ -9253,25 +9245,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionLoadscanEntity> abnormalLoadingPack = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() List<DistributionLoadscanEntity> abnormalLoadingPack = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryList.getId()) .eq(DistributionLoadscanEntity::getDeliveryId, deliveryList.getId())
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getIsAbnormalLoading, 2) .ne(DistributionLoadscanEntity::getIsAbnormalLoading, 2)
); );
int abnormalTotal = 0; int abnormalTotal = 0;
if (Func.isNotEmpty(abnormalLoadingPack)) { if (Func.isNotEmpty(abnormalLoadingPack)) {
abnormalTotal = abnormalLoadingPack.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); abnormalTotal = abnormalLoadingPack.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
} }
if (!packageLockIds.isEmpty()) { if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryList.getTrainNumber() + "orderPackageCode:"); List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryList.getTrainNumber() + ":orderPackageIds:");
if (Func.isNotEmpty(a)) { if (!Objects.isNull(a)) {
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any)); boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
if (flag) { if (flag) {
//正在操作,请稍后重试 //正在操作,请稍后重试
throw new CustomerException("该包件正在被操作,请稍后再试!!!"); throw new CustomerException("该包件正在被操作,请稍后再试!!!");
} else { } else {
packageLockIds.addAll(a); packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryList.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryList.getTrainNumber() + ":orderPackageIds:", packageLockIds, 60L);
} }
} else { } else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryList.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryList.getTrainNumber() + ":orderPackageIds:", packageLockIds, 60L);
} }
} }
trunklinePackageTrackLogClient.addPackageTrackLog(aaa); trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
@ -9358,7 +9350,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error(method + "DeliveryId参数缺失"); log.error(method + "DeliveryId参数缺失");
return R.fail("参数缺失,请联系管理员"); return R.fail("参数缺失,请联系管理员");
} }
BasicdataWarehouseEntity myCurrentWarehouseAndConfig = warehouseClient.getMyCurrentWarehouseAndConfig();
if (Objects.isNull(myCurrentWarehouseAndConfig)) {
return R.fail(403, "未授权!!!");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())) { if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())) {
log.error(method + "ReservationId参数缺失"); log.error(method + "ReservationId参数缺失");
return R.fail("参数缺失,请联系管理员"); return R.fail("参数缺失,请联系管理员");
@ -9368,24 +9363,230 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error(method + "LoadingAbnormalIds参数缺失"); log.error(method + "LoadingAbnormalIds参数缺失");
return R.fail("参数缺失,请联系管理员"); return R.fail("参数缺失,请联系管理员");
} }
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.listByIds(Func.toIntList(distrilbutionloadingscanDTO.getLoadingAbnormalIds()));
boolean isAuditingFlag = abnormalEntities.stream().anyMatch(a -> LoadingAbnormalAuditingStatusConstant.daishenhe.getValue().equals(a.getAuditingStatus())); List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.listByIds(Func.toLongList(distrilbutionloadingscanDTO.getLoadingAbnormalIds()));
boolean isAuditingFlag = abnormalEntities.stream().anyMatch(a -> !LoadingAbnormalAuditingStatusConstant.daishenhe.getValue().equals(a.getAuditingStatus()));
if (isAuditingFlag) { if (isAuditingFlag) {
String orderPackageCode = abnormalEntities.stream().filter(a -> !LoadingAbnormalAuditingStatusConstant.daishenhe.getValue().equals(a.getAuditingStatus())).map(String::valueOf).collect(Collectors.joining(",")); String orderPackageCode = abnormalEntities.stream().filter(a -> !LoadingAbnormalAuditingStatusConstant.daishenhe.getValue().equals(a.getAuditingStatus())).map(DistributionLoadscanAbnormalEntity::getPackageCode).collect(Collectors.joining(","));
return R.fail("取消失败" + orderPackageCode + "已处理"); return R.fail("取消失败" + orderPackageCode + "已处理");
} }
Long reservationId = distrilbutionloadingscanDTO.getReservationId(); Long reservationId = distrilbutionloadingscanDTO.getReservationId();
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId(); Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
//进行批量取消异常并且取消计划 //进行批量取消异常并且取消计划
cancelLoadscanAbnormalEntity(abnormalEntities,reservationId,deliveryId);
return null; return cancelLoadscanAbnormalEntity(abnormalEntities, reservationId, deliveryId,myCurrentWarehouseAndConfig.getId());
}
@Override
public R getAppDeliveryreservationNewTrays(DistributionAppDeliveryListDTO distributionDeliveryList) {
String method = "#############################################DistributionDeliveryInfoServiceImpl.getAppDeliveryreservationNewTrays";
if (Objects.isNull(distributionDeliveryList.getReservationId())) {
log.error(method + "reservationId参数缺失");
return R.fail("参数错误,联系管理员");
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
//查询预约信息
Long reservationId = Long.parseLong(distributionDeliveryList.getReservationId());
DistributionAppNewReservationVO reservationAppDetailVO = distributionDeliveryInfoMapper.selectNewAppcustom(reservationId);
if (Objects.isNull(reservationAppDetailVO)) {
log.error(method + "查询预约计划失败:{}", distributionDeliveryList.getReservationId());
return R.fail("参数错误,联系管理员");
}
List<Map<String, Object>> mapList = new ArrayList<>();
//查询托盘信息
List<String> trayList = distributionReservationMapper.selectTrayInfoByReservationId(reservationId);
if (!trayList.isEmpty()) {
for (String string : trayList) {
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(string);
if (Func.isNotEmpty(trayTypeDataVO)) {
String trayName = trayTypeDataVO.getTrayCode();
List<WarehouseTrayGoodsEntity> goodsLsit = trayTypeDataVO.getGoodsLsit();
if (Func.isNotEmpty(goodsLsit)) {
List<Long> longs = goodsLsit.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.listByIds(longs);
List<DistributionParcelListEntity> reservationPackageList = distributionReservationMapper.selectPackageListByReservationId(Long.parseLong(distributionDeliveryList.getReservationId()));
Map<Long, DistributionParcelListEntity> packageMap = reservationPackageList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2));
//该托盘的所有包件满足该计划下的所有
boolean flag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(packageMap.get(p.getId())));
if (flag) {
int sum = parcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
Map<String, Object> map = new HashMap<>();
map.put("trayName", trayName);
map.put("trayCode", trayTypeDataVO.getTrayCode());
map.put("trayNum", sum);
map.put("type", "定制品");
List<Map<String, Object>> packageList = createdTrayPackage(goodsLsit);
if (!packageList.isEmpty()) {
map.put("packageList", packageList);
}
mapList.add(map);
}
}
}
}
}
//组装已装车的托盘信息
List<Map<String, Object>> loadingMapTray = distributionReservationMapper.selectLoadingTrayInfoByReservationId(reservationId);
if (!loadingMapTray.isEmpty()) {
for (Map<String, Object> map : loadingMapTray) {
List<Map<String, Object>> packageList = handleLoadingTrayPackage(String.valueOf(map.get("trayName")), reservationId);
if (!packageList.isEmpty()) {
map.put("packageList", packageList);
}
}
mapList.addAll(loadingMapTray);
}
if (!mapList.isEmpty()) {
for (Map<String, Object> map : mapList) {
}
reservationAppDetailVO.setTrayList(mapList);
}
return R.data(reservationAppDetailVO);
}
private List<Map<String, Object>> handleLoadingTrayPackage(String trayName, Long reservationId) {
List<Map<String, Object>> mapList = new ArrayList<>();
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, reservationId)
.eq(DistributionLoadscanEntity::getTrayNo, trayName)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (!loadscanEntityList.isEmpty()) {
List<Long> packageIds = loadscanEntityList.stream().map(DistributionLoadscanEntity::getPackageId).distinct().collect(Collectors.toList());
for (DistributionParcelListEntity parcelListEntity : distributionParcelListService.listByIds(packageIds)) {
Map<String, Object> map = new HashMap<>();
map.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
map.put("first", parcelListEntity.getFirsts());
map.put("second", parcelListEntity.getSecond());
map.put("thirdProduct", parcelListEntity.getThirdProduct());
map.put("orderPackageLoadingStatus", parcelListEntity.getOrderPackageLoadingStatus());
mapList.add(map);
}
}
return mapList;
}
private List<Map<String, Object>> createdTrayPackage(List<WarehouseTrayGoodsEntity> goodsLsit) {
List<Map<String, Object>> mapList = new ArrayList<>();
List<Long> packageIds = goodsLsit.stream().map(WarehouseTrayGoodsEntity::getAssociationId).distinct().collect(Collectors.toList());
if (!packageIds.isEmpty()) {
for (DistributionParcelListEntity parcelListEntity : distributionParcelListService.listByIds(packageIds)) {
Map<String, Object> map = new HashMap<>();
map.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
map.put("first", parcelListEntity.getFirsts());
map.put("second", parcelListEntity.getSecond());
map.put("thirdProduct", parcelListEntity.getThirdProduct());
map.put("orderPackageLoadingStatus", parcelListEntity.getOrderPackageLoadingStatus());
mapList.add(map);
}
}
return mapList;
} }
private void cancelLoadscanAbnormalEntity(List<DistributionLoadscanAbnormalEntity> abnormalEntities,Long reservationId,Long deliveryId) { @Override
public R createdZeroRetention(String barcode) {
String method = "#############################################DistributionDeliveryInfoServiceImpl.getAppDeliveryreservationNewTrays";
if (Objects.isNull(barcode)) {
log.error(method + "barcode参数缺失");
return R.fail("参数错误,联系管理员");
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
log.error(method + "barcode参数缺失");
return R.fail(403, "未授权!!!");
}
//查询此订单是否有效
DistributionStockArticleEntity order = distributionStockArticleService.getOne(Wrappers.<DistributionStockArticleEntity>query().lambda()
.eq(DistributionStockArticleEntity::getOrderCode, barcode)
.eq(DistributionStockArticleEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (Objects.isNull(order)) {
log.error(method + "查询订单错误ordercode:{},warehouseId:{}", barcode, myCurrentWarehouse.getId());
return R.fail(barcode + "此订单信息不存在");
}
//查询此订单的装车数量进行回库数据构建
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getOrderId, order.getId())
.eq(DistributionLoadscanEntity::getWarehouseId, myCurrentWarehouse.getId())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
List<DistributionRetentionScanEntity> retentionScanVos = new ArrayList<>();
if (!loadscanEntityList.isEmpty()) {
boolean isAllSignfor = loadscanEntityList.stream().allMatch(a -> Objects.equals(a.getPackageNub(), a.getReceivedQuantity()));
if (isAllSignfor) {
return R.fail("当前订单已完成签收");
}
List<DistributionLoadscanEntity> returnZeroList = loadscanEntityList.stream().filter(a -> !Objects.equals(a.getPackageNub(), a.getReceivedQuantity())).collect(Collectors.toList());
for (DistributionLoadscanEntity distributionLoadscanEntity : returnZeroList) {
DistributionRetentionScanEntity packageRetentionScanVo = buildZeroRetentionEntity(distributionLoadscanEntity);
retentionScanVos.add(packageRetentionScanVo);
}
}
return R.data(retentionScanVos);
}
@Override
@Transactional
public boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
return false;
}
List<Long> ids = new ArrayList<>();
ids.add(orderId);
distributionReservationZeroPackageService.reduceNum(reservationId,orderId,orderPackageId,retentionQuantity);
distributionStockArticleService.maintenanceOrderInfoByIds(ids);
distributionParcelListService.maintenanceZerpPackageInfo(orderPackageId);
distributionParcelListService.maintenanceZerpPackageInfo(orderPackageId);
distributionReservationService.maintenanceReservationNum(reservationId);
distributionReservationService.maintenanceReservationInfo(reservationId);
distributionDeliveryListService.maintenanceDeliveryNum(deliveryId);
distributionDeliveryListService.maintenanceDeliveryInfo(deliveryId);
return true;
}
private DistributionRetentionScanEntity buildZeroRetentionEntity(DistributionLoadscanEntity loadscanEntity) {
DistributionRetentionScanEntity packageRetentionScanEntity = new DistributionRetentionScanEntity();
packageRetentionScanEntity.setDeliveryId(loadscanEntity.getDeliveryId());
packageRetentionScanEntity.setOrderId(loadscanEntity.getOrderId());
packageRetentionScanEntity.setReservationId(loadscanEntity.getReservationId());
packageRetentionScanEntity.setTrainNumber(loadscanEntity.getTrainNumber());
packageRetentionScanEntity.setConditions(1);
packageRetentionScanEntity.setRetentionQuantity(loadscanEntity.getPackageNub() - loadscanEntity.getReceivedQuantity());
packageRetentionScanEntity.setOrderPackageId(loadscanEntity.getPackageId());
//查询包件
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(loadscanEntity.getPackageId());
packageRetentionScanEntity.setOrderCode(parcelListEntity.getOrderCode());
packageRetentionScanEntity.setOrderPackageCode(parcelListEntity.getOrderCode());
packageRetentionScanEntity.setWaybillNumber(parcelListEntity.getWaybillNumber());
packageRetentionScanEntity.setMaterialName(parcelListEntity.getFirsts());
packageRetentionScanEntity.setMaterialNumber(parcelListEntity.getMaterialCode());
packageRetentionScanEntity.setWaybillId(parcelListEntity.getWaybillId());
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(loadscanEntity.getReservationId());
packageRetentionScanEntity.setReservationCode(reservationEntity.getReservationCode());
packageRetentionScanEntity.setWarehouseId(loadscanEntity.getWarehouseId());
packageRetentionScanEntity.setWarehouseName(loadscanEntity.getWarehouseName());
packageRetentionScanEntity.setLoadingId(loadscanEntity.getId());
packageRetentionScanEntity.setRetentionType(RetentionSourceTypeConstant.zizhuxinzeng.getValue());
packageRetentionScanEntity.setVehicleNumber(loadscanEntity.getVehicleName());
// packageRetentionScanEntity.setTaskCode(distributionReservationService.retentionMa());
packageRetentionScanEntity.setDeliveryType(Integer.parseInt(reservationEntity.getDeliveryType()));
return packageRetentionScanEntity;
}
private R cancelLoadscanAbnormalEntity(List<DistributionLoadscanAbnormalEntity> abnormalEntities, Long reservationId, Long deliveryId,Long warehouseId) {
List<Long> packageIds = new ArrayList<>(); List<Long> packageIds = new ArrayList<>();
List<Long> inventoryPackageIds = new ArrayList<>(); List<Long> inventoryPackageIds = new ArrayList<>();
List<DistributionLoadscanAbnormalEntity> cancelZeroData = new ArrayList<>();
//进行异常的取消标注
List<Long> cancelIds = new ArrayList<>();
for (DistributionLoadscanAbnormalEntity abnormalEntity : abnormalEntities) { for (DistributionLoadscanAbnormalEntity abnormalEntity : abnormalEntities) {
abnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.yiquxiao.getValue()); abnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.yiquxiao.getValue());
abnormalEntity.setAuditingUser(AuthUtil.getUserName()); abnormalEntity.setAuditingUser(AuthUtil.getUserName());
@ -9396,6 +9597,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//订制品 //订制品
break; break;
case 2: case 2:
cancelZeroData.add(abnormalEntity);
//零担 //零担
break; break;
case 3: case 3:
@ -9403,6 +9605,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
inventoryPackageIds.add(abnormalEntity.getPackageId()); inventoryPackageIds.add(abnormalEntity.getPackageId());
break; break;
} }
cancelIds.add(abnormalEntity.getId());
} }
if (!packageIds.isEmpty()) { if (!packageIds.isEmpty()) {
@ -9421,11 +9624,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionCancelReservationPackageDTO.setDeliveryId(deliveryId); distributionCancelReservationPackageDTO.setDeliveryId(deliveryId);
distributionReservationService.cancelReservationPackage(distributionCancelReservationPackageDTO); distributionReservationService.cancelReservationPackage(distributionCancelReservationPackageDTO);
} }
if (!cancelZeroData.isEmpty()) {
distributionReservationService.cancelReservationZeroPackage(cancelZeroData,warehouseId);
}
if (!cancelIds.isEmpty()) {
distributionLoadscanAbnormalService.update(Wrappers.<DistributionLoadscanAbnormalEntity>update().lambda()
.in(DistributionLoadscanAbnormalEntity::getId, cancelIds)
.set(DistributionLoadscanAbnormalEntity::getAuditingUser, AuthUtil.getNickName())
.set(DistributionLoadscanAbnormalEntity::getAuditingTime, new Date())
.set(DistributionLoadscanAbnormalEntity::getAuditingStatus, LoadingAbnormalAuditingStatusConstant.yiquxiao.getValue())
.set(DistributionLoadscanAbnormalEntity::getComplete, Integer.parseInt(IsOrNoConstant.yes.getValue()))
);
}
distributionReservationService.maintenanceReservationInfo(reservationId); distributionReservationService.maintenanceReservationInfo(reservationId);
distributionReservationService.maintenanceReservationNum(reservationId); distributionReservationService.maintenanceReservationNum(reservationId);
distributionDeliveryListService.maintenanceDeliveryInfo(deliveryId); distributionDeliveryListService.maintenanceDeliveryInfo(deliveryId);
distributionDeliveryListService.maintenanceDeliveryNum(deliveryId); distributionDeliveryListService.maintenanceDeliveryNum(deliveryId);
return R.success("操作成功");
} }
@ -9634,7 +9850,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return loadscanEntity; return loadscanEntity;
} }
private DistributionDeliverySelfEntity getDriver(DistributionDeliveryListEntity deliveryListEntity, BladeUser user, DistrilbutionloadingscanDTO distrilbutionloadingscanDTO, boolean isDriverFlag) { @Override
public DistributionDeliverySelfEntity getDriver(DistributionDeliveryListEntity deliveryListEntity, BladeUser user, String vehicleNub, boolean isDriverFlag) {
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity(); DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
if ("1".equals(deliveryListEntity.getKind())) { if ("1".equals(deliveryListEntity.getKind())) {
if (isDriverFlag) { if (isDriverFlag) {
@ -9646,12 +9863,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询当前扫描司机是否属于当前配送任务 //查询当前扫描司机是否属于当前配送任务
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectDriverInfoByDeliveryIdAndDriverId(driverArtery.getId(), deliveryListEntity.getId()); distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectDriverInfoByDeliveryIdAndDriverId(driverArtery.getId(), deliveryListEntity.getId());
} else { } else {
if (Objects.isNull(distrilbutionloadingscanDTO.getVehicleNub())) { if (Objects.isNull(vehicleNub)) {
log.error("文员扫描未选择司机!!"); log.error("文员扫描未选择司机!!");
throw new CustomerException("文员扫描未选择司机"); throw new CustomerException("文员扫描未选择司机");
} }
//默认为文员进行扫描,此时需要文员选择进行帮助扫描的司机 //默认为文员进行扫描,此时需要文员选择进行帮助扫描的司机
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectDriverInfoByDeliveryIdAndVehicleNub(deliveryListEntity.getId(), distrilbutionloadingscanDTO.getVehicleNub()); distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectDriverInfoByDeliveryIdAndVehicleNub(deliveryListEntity.getId(), vehicleNub);
if (Objects.isNull(distributionDeliverySelfEntity)) { if (Objects.isNull(distributionDeliverySelfEntity)) {
log.error("没有司机的信息!!"); log.error("没有司机的信息!!");
throw new CustomerException("没有司机的信息"); throw new CustomerException("没有司机的信息");

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

@ -4223,6 +4223,19 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} }
} }
@Override
public void cancelReservationZeroPackage(List<DistributionLoadscanAbnormalEntity> cancelZeroData,Long warehouseId) {
for (DistributionLoadscanAbnormalEntity cancelZeroDatum : cancelZeroData) {
//进行零担计划取消指定数量进行取消
distributionReservationMapper.cancelReservationZeroPackage(cancelZeroDatum.getReservationId(),cancelZeroDatum.getPackageId(),cancelZeroDatum.getLoadingQuantity());
distributionReservationZeroPackageService.maintainReservationZeroPackage(cancelZeroDatum.getReservationId(),cancelZeroDatum.getPackageId());
distributionReservationStockarticleService.maintenanceReservationStockArticleNum(cancelZeroDatum.getReservationId(),cancelZeroDatum.getStockArticleId(),warehouseId);
distributionReservationStockarticleService.maintenanceReservationStockArticle(cancelZeroDatum.getReservationId(),warehouseId);
}
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) { private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject(); JSONObject trunklinePackageTrackLog = new JSONObject();

57
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java

@ -26,14 +26,13 @@ import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.distribution.excel.DistributionReservationZeroPackageExcel; import com.logpm.distribution.excel.DistributionReservationZeroPackageExcel;
import com.logpm.distribution.mapper.DistributionParcelListMapper; import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionReservationZeroPackageMapper; import com.logpm.distribution.mapper.DistributionReservationZeroPackageMapper;
import com.logpm.distribution.service.IDistributionParcelListService; import com.logpm.distribution.service.*;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import com.logpm.distribution.service.IDistributionReservationZeroPackageService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionReservationZeroPackageVO; import com.logpm.distribution.vo.DistributionReservationZeroPackageVO;
import io.jsonwebtoken.lang.Objects;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant; import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -59,6 +58,10 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
@Lazy @Lazy
private IDistributionStockArticleService distributionStockArticleService; private IDistributionStockArticleService distributionStockArticleService;
@Autowired
@Lazy
private IDistributionReservationStockarticleService distributionReservationStockarticleService;
@Override @Override
public IPage<DistributionReservationZeroPackageVO> selectDistributionReservationZeroPackagePage(IPage<DistributionReservationZeroPackageVO> page, DistributionReservationZeroPackageVO distributionReservationZeroPackage) { public IPage<DistributionReservationZeroPackageVO> selectDistributionReservationZeroPackagePage(IPage<DistributionReservationZeroPackageVO> page, DistributionReservationZeroPackageVO distributionReservationZeroPackage) {
@ -137,4 +140,50 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
} }
@Override
@Transactional
public void maintainReservationZeroPackage(Long reservationId, Long packageId) {
DistributionReservationZeroPackageEntity one = this.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.eq(DistributionReservationZeroPackageEntity::getParcelListId, packageId)
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!Func.isNull(one)){
if (one.getQuantity() == 0) {
one.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
this.updateById(one);
}
}
}
@Override
@Transactional
public void reduceNum(Long reservationId, Long orderId, Long orderPackageId, Integer retentionQuantity) {
DistributionReservationZeroPackageEntity one = this.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, orderId)
.eq(DistributionReservationZeroPackageEntity::getParcelListId, orderPackageId)
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!Func.isEmpty(one)){
Integer quantity = one.getQuantity();
one.setQuantity((quantity-retentionQuantity));
if ((quantity-retentionQuantity) == 0) {
one.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
}
this.updateById(one);
//
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, orderPackageId)
);
int handQuantity = distributionParcelNumberEntity.getHandQuantity() + retentionQuantity;
Integer outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() - retentionQuantity;
distributionParcelNumberEntity.setOutboundQuantity(outboundQuantity);
distributionParcelNumberEntity.setHandQuantity(handQuantity);
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
}
}
} }

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

@ -6293,6 +6293,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanAbnormalEntity.setAuditingStatus(2); distributionLoadscanAbnormalEntity.setAuditingStatus(2);
distributionLoadscanAbnormalEntity.setAuditingTime(new Date()); distributionLoadscanAbnormalEntity.setAuditingTime(new Date());
distributionLoadscanAbnormalEntity.setAuditingUser(AuthUtil.getUser().getNickName()); distributionLoadscanAbnormalEntity.setAuditingUser(AuthUtil.getUser().getNickName());
distributionLoadscanAbnormalEntity.setComplete(Integer.parseInt(IsOrNoConstant.yes.getValue()));
distributionLoadscanAbnormalService.updateById(distributionLoadscanAbnormalEntity); distributionLoadscanAbnormalService.updateById(distributionLoadscanAbnormalEntity);
reservationEntity.setReservationNum(reservationEntity.getReservationNum() + distributionLoadscanAbnormalEntity.getLoadingQuantity()); reservationEntity.setReservationNum(reservationEntity.getReservationNum() + distributionLoadscanAbnormalEntity.getLoadingQuantity());
distributionReservationMapper.updateById(reservationEntity); distributionReservationMapper.updateById(reservationEntity);
@ -7574,10 +7575,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<JSONObject> aaa = new ArrayList<>(); List<JSONObject> aaa = new ArrayList<>();
DistributionReservationPackageEntity planPackage = distributionReservationPackageService.getPlanPackageByReservationAndCode(reservationId,barcode); DistributionReservationPackageEntity planPackage = distributionReservationPackageService.getPlanPackageByReservationAndCode(reservationId,barcode);
if (!Objects.isNull(planPackage)){ if (!Objects.isNull(planPackage)){
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
return Resp.scanFail("包件已签收", "包件已签收");
}
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda() List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, barcode) .eq(DistributionLoadscanAbnormalEntity::getPackageCode, barcode)
.eq(DistributionLoadscanAbnormalEntity::getGoodsType, 1) .eq(DistributionLoadscanAbnormalEntity::getGoodsType, 1)
.eq(DistributionLoadscanAbnormalEntity::getAbnormalType, 3) .ne(DistributionLoadscanAbnormalEntity::getAbnormalType, 1)
.eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, LoadingAbnormalAuditingStatusConstant.daishenhe.getValue()) .eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, LoadingAbnormalAuditingStatusConstant.daishenhe.getValue())
//修改 状态 //修改 状态
); );
@ -7637,12 +7641,22 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//维护签收包件状态 //维护签收包件状态
orderCodes.add(parcelListEntity.getOrderCode()); orderCodes.add(parcelListEntity.getOrderCode());
} else { } else {
//判断当前包件是否已进行签收 //判断当前包件是否已进行签收
//判断客户 //判断客户
boolean flag = judgmentClient(reservationEntity, parcelListEntity.getStockArticleId()); boolean flag = judgmentClient(reservationEntity, parcelListEntity.getStockArticleId());
if (flag) { if (flag) {
return R.fail(3006, null); return R.fail(3006, null);
} else { } else {
//查询出未审核如果存在多个则不行
DistributionLoadscanAbnormalEntity abnormalEntity = distributionLoadscanAbnormalService.getOne(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getDeliveryListId, deliveryId)
.eq(DistributionLoadscanAbnormalEntity::getReservationId, reservationId)
.eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, LoadingAbnormalAuditingStatusConstant.daishenhe.getValue())
);
if (!Objects.isNull(abnormalEntity)){
return Resp.scanFail("此包件存在需回库操作", "此包件存在需回库操作");
}
return Resp.scanFail("不属于当前签收客户", "不属于当前签收客户"); return Resp.scanFail("不属于当前签收客户", "不属于当前签收客户");
} }
} }
@ -8410,7 +8424,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.set(DistributionLoadscanAbnormalEntity::getAuditingUser,AuthUtil.getNickName()) .set(DistributionLoadscanAbnormalEntity::getAuditingUser,AuthUtil.getNickName())
.set(DistributionLoadscanAbnormalEntity::getAuditingTime,new Date()) .set(DistributionLoadscanAbnormalEntity::getAuditingTime,new Date())
); );
List<WarehouseRetentionScanEntity> entityList = createdRetentionScanEntity(loadscanEntityList,myCurrentWarehouse,AuthUtil.getUser(),reservationEntity,deliveryListEntity); List<WarehouseRetentionScanEntity> entityList = createdRetentionScanEntityList(loadscanEntityList,myCurrentWarehouse,AuthUtil.getUser(),reservationEntity,deliveryListEntity,abnormalEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanAbnormalEntity::getLoadingId)));
if (!entityList.isEmpty()){ if (!entityList.isEmpty()){
//进行批量回库任务提交 //进行批量回库任务提交
warehouseRetentionScanClient.saveBatchRetentionScan(entityList); warehouseRetentionScanClient.saveBatchRetentionScan(entityList);
@ -8434,7 +8448,124 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} }
private List<WarehouseRetentionScanEntity> createdRetentionScanEntity(List<DistributionLoadscanEntity> loadscanEntityList, BasicdataWarehouseEntity myCurrentWarehouse, BladeUser user, DistributionReservationEntity reservationEntity, DistributionDeliveryListEntity deliveryListEntity) { @Override
public R newCancelAbnormalSignfor(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
String method = "####################异常签收拒签newCancelAbnormalSignfor";
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())){
log.error(method+"reservationId参数缺失");
return R.fail(method+"reservationId参数缺失");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())){
log.error(method+"barcode参数缺失");
return R.fail(method+"barcode参数缺失");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())){
log.error(method+"deliveryId参数缺失");
return R.fail(method+"deliveryId参数缺失");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
log.error(method+"deliveryId参数缺失");
return R.fail(403,"未授权!!!");
}
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
//查询预约
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Objects.isNull(reservationEntity)){
log.error(method+"查询预约计划错误reservationId:{}",distrilbutionloadingscanDTO.getReservationId());
return R.fail("查询预约计划错误");
}
//查询配送
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(deliveryId);
if (Objects.isNull(deliveryListEntity)){
log.error(method+"查询配送计划错误deliveryId:{}",distrilbutionloadingscanDTO.getDeliveryId());
return R.fail("查询配送计划错误");
}
//查询包件
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (Objects.isNull(parcelListEntity)){
log.error(method+"系统无编码,orderPackageCode:{},warehouseId:{}",distrilbutionloadingscanDTO.getBarcode(),myCurrentWarehouse.getId());
return R.fail("系统无编码");
}
//查询当前登录人所在计划
BladeUser user = AuthUtil.getUser();
Boolean isDriverFlag = distributionDeliveryListService.judgeIsDriver(user);
if (!isDriverFlag) {
return Resp.scanFail("此操作只能司机完成","此操作只能司机完成");
}
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliveryListService.getDriver(deliveryListEntity, user, null, isDriverFlag);
List<JSONObject> logList = new ArrayList<>();
//生成异常
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity();
distributionLoadscanAbnormalEntity.setDeliveryType(deliveryListEntity.getType());
distributionLoadscanAbnormalEntity.setDeliveryListId(deliveryListEntity.getId());
distributionLoadscanAbnormalEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
distributionLoadscanAbnormalEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionLoadscanAbnormalEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionLoadscanAbnormalEntity.setReservationId(reservationEntity.getId());
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue());
distributionLoadscanAbnormalEntity.setGoodsType(1);
distributionLoadscanAbnormalEntity.setPackageId(parcelListEntity.getId());
distributionLoadscanAbnormalEntity.setStockArticleId(parcelListEntity.getStockArticleId());
distributionLoadscanAbnormalEntity.setPackageCode(parcelListEntity.getOrderPackageCode());
distributionLoadscanAbnormalEntity.setScanUser(user.getNickName());
distributionLoadscanAbnormalEntity.setScanTime(new Date());
distributionLoadscanAbnormalEntity.setDriverId(Long.parseLong(deliverySelfEntity.getDriverId()));
distributionLoadscanAbnormalEntity.setDriverName(deliverySelfEntity.getDriverName());
distributionLoadscanAbnormalEntity.setDriverPhone(deliverySelfEntity.getDriverPhone());
distributionLoadscanAbnormalEntity.setVehicleId(Long.parseLong(deliverySelfEntity.getVehicleId()));
distributionLoadscanAbnormalEntity.setVehicleName(deliverySelfEntity.getVehicleNub());
distributionLoadscanAbnormalEntity.setLoadingQuantity(parcelListEntity.getQuantity());
distributionLoadscanAbnormalEntity.setAbnormalType(LoadingAbnormalTypeConstant.yichangjuqian.getValue());
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity);
//生成回库
createdRefuseSignfor(myCurrentWarehouse,deliveryListEntity,reservationEntity,deliverySelfEntity,parcelListEntity,distributionLoadscanAbnormalEntity.getId());
//记录当前包件生成待回库任务
String content = "包件在" + myCurrentWarehouse.getName() + "由" + user.getNickName() + "异常签收拒签生成待回库任务,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject jsonObject = handleLogJSONObject(myCurrentWarehouse, user, parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_REJECT.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
logList.add(jsonObject);
if (!logList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
}
return Resp.scanSuccess("操作成功","操作成功");
}
private void createdRefuseSignfor(BasicdataWarehouseEntity myCurrentWarehouse,DistributionDeliveryListEntity deliveryListEntity,DistributionReservationEntity reservationEntity,DistributionDeliverySelfEntity deliverySelfEntity,DistributionParcelListEntity parcelListEntity,Long abnormalId) {
WarehouseRetentionScanEntity warehouseRetentionScanEntity = new WarehouseRetentionScanEntity();
warehouseRetentionScanEntity.setWarehouseName(myCurrentWarehouse.getName());
warehouseRetentionScanEntity.setTaskCode(distributionReservationService.retentionMa());
warehouseRetentionScanEntity.setWarehouseId(myCurrentWarehouse.getId());
warehouseRetentionScanEntity.setLoadingId(myCurrentWarehouse.getId());
warehouseRetentionScanEntity.setDeliveryId(deliveryListEntity.getId());
warehouseRetentionScanEntity.setReservationId(reservationEntity.getId());
warehouseRetentionScanEntity.setConditions(1);
warehouseRetentionScanEntity.setReservationCode(reservationEntity.getReservationCode());
warehouseRetentionScanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
//查询此包件
//订单运单信息填充
warehouseRetentionScanEntity.setOrderCode(parcelListEntity.getOrderCode());
warehouseRetentionScanEntity.setWaybillNumber(parcelListEntity.getWaybillNumber());
warehouseRetentionScanEntity.setWaybillId(parcelListEntity.getWaybillId());
warehouseRetentionScanEntity.setOrderId(parcelListEntity.getStockArticleId());
warehouseRetentionScanEntity.setRetentionQuantity(parcelListEntity.getQuantity());
warehouseRetentionScanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
warehouseRetentionScanEntity.setOrderPackageId(parcelListEntity.getId());
warehouseRetentionScanEntity.setVehicleNumber(deliverySelfEntity.getVehicleNub());
warehouseRetentionScanEntity.setRetentionType(3);
warehouseRetentionScanEntity.setDeliveryType(Integer.parseInt(deliveryListEntity.getType()));
warehouseRetentionScanEntity.setConfirmStatus(false);
warehouseRetentionScanEntity.setAbnormalId(abnormalId);
warehouseRetentionScanClient.saveRetentionScan(warehouseRetentionScanEntity);
}
private List<WarehouseRetentionScanEntity> createdRetentionScanEntityList(List<DistributionLoadscanEntity> loadscanEntityList,
BasicdataWarehouseEntity myCurrentWarehouse,
BladeUser user,
DistributionReservationEntity reservationEntity,
DistributionDeliveryListEntity deliveryListEntity,
Map<Long, List<DistributionLoadscanAbnormalEntity>> longListMap) {
List<WarehouseRetentionScanEntity> entityList = new ArrayList<>(); List<WarehouseRetentionScanEntity> entityList = new ArrayList<>();
List<JSONObject> logList = new ArrayList<>(); List<JSONObject> logList = new ArrayList<>();
for (DistributionLoadscanEntity distributionLoadscanEntity : loadscanEntityList) { for (DistributionLoadscanEntity distributionLoadscanEntity : loadscanEntityList) {
@ -8449,7 +8580,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseRetentionScanEntity.setConditions(1); warehouseRetentionScanEntity.setConditions(1);
warehouseRetentionScanEntity.setReservationCode(reservationEntity.getReservationCode()); warehouseRetentionScanEntity.setReservationCode(reservationEntity.getReservationCode());
warehouseRetentionScanEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); warehouseRetentionScanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
Long abnormalId = longListMap.get(distributionLoadscanEntity.getId()).get(0).getId();
warehouseRetentionScanEntity.setAbnormalId(abnormalId);
//查询此包件 //查询此包件
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (!Objects.isNull(parcelListEntity)){ if (!Objects.isNull(parcelListEntity)){

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

@ -17,6 +17,8 @@
package com.logpm.warehouse.feign; package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionRetentionScanEntity;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO; import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity; import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.service.IWarehouseRetentionScanService; import com.logpm.warehouse.service.IWarehouseRetentionScanService;
@ -79,4 +81,11 @@ public class WarehouseRetentionScanClient implements IWarehouseRetentionScanClie
return warehouseRetentionScanService.getRetentionScanEntityListByWarehouseId(warehouseId,taskTimeStart,taskTimeEnd); return warehouseRetentionScanService.getRetentionScanEntityListByWarehouseId(warehouseId,taskTimeStart,taskTimeEnd);
} }
@Override
public boolean judgeIsHaveRetention(String orderPackageCode, Long warehouseId) {
return warehouseRetentionScanService.judgeIsHaveRetention(orderPackageCode,warehouseId);
}
} }

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

@ -85,4 +85,5 @@ public interface WarehouseRetentionScanMapper extends BaseMapper<WarehouseRetent
* @return * @return
*/ */
IPage<WarehouseRetentionScanVO> selectWarehouseRetentionRecordNewPage(IPage<WarehouseRetentionScanVO> page,@Param("param") WarehouseRetentionScanDTO warehouseRetentionScan); IPage<WarehouseRetentionScanVO> selectWarehouseRetentionRecordNewPage(IPage<WarehouseRetentionScanVO> page,@Param("param") WarehouseRetentionScanDTO warehouseRetentionScan);
} }

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionScanService.java

@ -94,6 +94,14 @@ public interface IWarehouseRetentionScanService extends IService<WarehouseRetent
*/ */
R selectWarehouseRetentionRecordNewPage(IPage<WarehouseRetentionScanVO> page, WarehouseRetentionScanDTO warehouseRetentionScan); R selectWarehouseRetentionRecordNewPage(IPage<WarehouseRetentionScanVO> page, WarehouseRetentionScanDTO warehouseRetentionScan);
/**
* 查询仓库某一包件是否存在回库任务
* @param orderPackageCode
* @param warehouseId
* @return
*/
boolean judgeIsHaveRetention(String orderPackageCode, Long warehouseId);
// R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordEntity); // R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordEntity);

32
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -83,6 +83,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
private final IDistributionDeliveryListClient distributionDeliveryListClient; private final IDistributionDeliveryListClient distributionDeliveryListClient;
private final IDistributionReservationClient distributionReservationClient; private final IDistributionReservationClient distributionReservationClient;
private final IDistributionSignforClient distributionSignforClient; private final IDistributionSignforClient distributionSignforClient;
private final IDistributionLoadscanAbnormalClient distributionLoadscanAbnormalClient;
@Override @Override
public IPage<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage<WarehouseRetentionRecordVO> page, WarehouseRetentionRecordVO warehouseRetentionRecord) { public IPage<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage<WarehouseRetentionRecordVO> page, WarehouseRetentionRecordVO warehouseRetentionRecord) {
@ -402,8 +403,8 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
.collect(Collectors.toList()) .collect(Collectors.toList())
.contains(f.getOrderPackageCode())) .contains(f.getOrderPackageCode()))
.map(WarehouseRetentionScanEntity::getOrderPackageCode).collect(Collectors.joining(",")); .map(WarehouseRetentionScanEntity::getOrderPackageCode).collect(Collectors.joining(","));
if (Objects.isNull(collect)){ if (Objects.isNull(collect)) {
return R.fail(collect+"重复滞留"); return R.fail(collect + "重复滞留");
} }
} }
for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : warehouseRetentionScanEntities) { for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : warehouseRetentionScanEntities) {
@ -435,21 +436,21 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
@Override @Override
public R scanRetention(WarehouseRetentionScanDTO warehouseRetentionScanDTO) { public R scanRetention(WarehouseRetentionScanDTO warehouseRetentionScanDTO) {
String method = "########################################WarehouseRetenntionServiceImpl.scanRetention"; String method = "########################################WarehouseRetenntionServiceImpl.scanRetention";
if (Objects.isNull(warehouseRetentionScanDTO.getOrderPackageCode())){ if (Objects.isNull(warehouseRetentionScanDTO.getOrderPackageCode())) {
log.error(method+"OrderPackageCode参数缺失"); log.error(method + "OrderPackageCode参数缺失");
return Resp.scanFail("参数缺失,请联系管理员","参数缺失,请联系管理员"); return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
} }
//查询此列表此包件是否存在任务 //查询此列表此包件是否存在任务
BasicdataWarehouseEntity myCurrentWarehouseAndConfig = warehouseClient.getMyCurrentWarehouseAndConfig(); BasicdataWarehouseEntity myCurrentWarehouseAndConfig = warehouseClient.getMyCurrentWarehouseAndConfig();
if (Objects.isNull(myCurrentWarehouseAndConfig)){ if (Objects.isNull(myCurrentWarehouseAndConfig)) {
return R.fail(403,"未授权"); return R.fail(403, "未授权");
} }
String orderPackageCode = warehouseRetentionScanDTO.getOrderPackageCode(); String orderPackageCode = warehouseRetentionScanDTO.getOrderPackageCode();
List<WarehouseRetentionScanEntity> retentionScanEntityList = warehouseRetentionScanService.getEntityByCodeAndWarehouseId(orderPackageCode,myCurrentWarehouseAndConfig.getId()); List<WarehouseRetentionScanEntity> retentionScanEntityList = warehouseRetentionScanService.getEntityByCodeAndWarehouseId(orderPackageCode, myCurrentWarehouseAndConfig.getId());
if (retentionScanEntityList.isEmpty()) { if (retentionScanEntityList.isEmpty()) {
//返回当前包件的配送信息准备进行新增 //返回当前包件的配送信息准备进行新增
return R.fail(1500,"新增回库任务"); return R.fail(1500, "新增回库任务");
} }
AtomicBoolean saveFlah = new AtomicBoolean(false); AtomicBoolean saveFlah = new AtomicBoolean(false);
for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : retentionScanEntityList) { for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : retentionScanEntityList) {
@ -459,15 +460,15 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions())); saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions()));
break; break;
case 2: case 2:
//库存品 //回库指定数量的零担包件
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId())); saveFlah.set(distributionDeliveryListClient.retentionReservationZeroPackageByNum(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId()));
break; break;
case 3: case 3:
//零担 //库存品
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId())); saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId()));
break; break;
} }
if (saveFlah.get()){ if (saveFlah.get()) {
warehouseRetentionScanEntity.setConfirmStatus(true); warehouseRetentionScanEntity.setConfirmStatus(true);
warehouseRetentionScanEntity.setRetentionScanUsername(AuthUtil.getNickName()); warehouseRetentionScanEntity.setRetentionScanUsername(AuthUtil.getNickName());
warehouseRetentionScanEntity.setRetentionScanUserId(AuthUtil.getUserId()); warehouseRetentionScanEntity.setRetentionScanUserId(AuthUtil.getUserId());
@ -475,6 +476,8 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
warehouseRetentionScanService.updateById(warehouseRetentionScanEntity); warehouseRetentionScanService.updateById(warehouseRetentionScanEntity);
//维护签收表的异常状态 //维护签收表的异常状态
distributionSignforClient.maintainIsHaveAbnormalPackage(warehouseRetentionScanEntity.getReservationId()); distributionSignforClient.maintainIsHaveAbnormalPackage(warehouseRetentionScanEntity.getReservationId());
//对此回库任务绑定的异常标注完成
distributionLoadscanAbnormalClient.completeAbnormal(warehouseRetentionScanEntity.getAbnormalId());
} }
} }
if (saveFlah.get()) { if (saveFlah.get()) {
@ -483,5 +486,4 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
throw new CustomerException("服务器正忙..."); throw new CustomerException("服务器正忙...");
} }
} }
} }

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java

@ -16,8 +16,10 @@
*/ */
package com.logpm.warehouse.service.impl; package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionRetentionScanEntity;
import com.logpm.distribution.feign.IDistributionReservationClient; import com.logpm.distribution.feign.IDistributionReservationClient;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO; import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.bean.Resp; import com.logpm.warehouse.bean.Resp;
@ -156,4 +158,13 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl<Warehouse
return R.data(baseMapper.selectWarehouseRetentionRecordNewPage(page, warehouseRetentionScan)); return R.data(baseMapper.selectWarehouseRetentionRecordNewPage(page, warehouseRetentionScan));
} }
@Override
public boolean judgeIsHaveRetention(String orderPackageCode, Long warehouseId) {
List<WarehouseRetentionScanEntity> retentionScanEntityList = baseMapper.getEntityByCodeAndWarehouseId(orderPackageCode,warehouseId);
if (!retentionScanEntityList.isEmpty()) {
return true;
}
return false;
}
} }

Loading…
Cancel
Save