Browse Source

新装车BUG修复

dist.1.3.0
汤建军 6 months ago
parent
commit
39ecc2eeca
  1. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSignPrintEntity.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionBillLadingAppController.java
  3. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanAbnormalMapper.java
  4. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanAbnormalMapper.xml
  5. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml
  6. 99
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  7. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionLoadscanAbnormalService.java
  8. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  9. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionLoadscanAbnormalServiceImpl.java
  10. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  11. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  12. 2141
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSignPrintEntity.java

@ -82,4 +82,16 @@ public class DistributionSignPrintEntity extends TenantEntity {
@ApiModelProperty(value = "预约id")
private Long reservationId;
/**
* 操作人ID
*/
@ApiModelProperty(value = "操作人ID")
private Long operatorId;
/**
* 操作人名称
*/
@ApiModelProperty(value = "操作人名称")
private String operatorUsername;
}

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

@ -250,6 +250,4 @@ public class DistributionBillLadingAppController extends BladeController {
R b = distrilbutionBillLadingService.getReceivedImage(billLadingAppDTO);
return b;
}
}

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

@ -59,4 +59,13 @@ public interface DistributionLoadscanAbnormalMapper extends BaseMapper<Distribut
* @param username
*/
void completeLoadingAbnormal(@Param("orderPackageCode") String orderPackageCode,@Param("warehouseId") Long warehouseId,@Param("reservationId") Long reservationId,@Param("username") String username);
/**
* 查询是否存在有异常装车或异常签收
* @param reservationId
* @param deliveryId
* @param warehouseId
* @return
*/
int isHaveAbnormalPackage(@Param("reservationId")Long reservationId,@Param("deliveryId") Long deliveryId,@Param("warehouseId") Long warehouseId);
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanAbnormalMapper.xml

@ -64,5 +64,8 @@
<select id="exportDistributionLoadscanAbnormal" resultType="com.logpm.distribution.excel.DistributionLoadscanAbnormalExcel">
SELECT * FROM logpm_distribution_loadscan_abnormal ${ew.customSqlSegment}
</select>
<select id="isHaveAbnormalPackage" resultType="java.lang.Integer">
SELECT IFNULL(SUM(loading_quantity),0) FROM logpm_distribution_loadscan_abnormal WHERE reservation_id = #{reservationId} AND delivery_list_id = #{deliveryId} AND warehouse_id = #{warehouseId}
</select>
</mapper>

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

@ -130,9 +130,9 @@
(IF((SELECT sum(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE reservation_id = #{reservationId} AND scan_state != 1 AND signfor_state = 2)is null,0,(SELECT sum(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE reservation_id = #{reservationId} AND scan_state != 1 AND signfor_state = 2)))
</select>
<select id="selectSigningNumByDeliveryId" resultType="java.lang.Integer">
SELECT (IF((SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE delivery_id = #{deliveryId} AND scan_state != 1 AND is_abnormal_loading != 2 AND signfor_state = 2) is null,0,(SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE delivery_id = #{deliveryId} AND scan_state != 1 AND is_abnormal_loading != 2 AND signfor_state = 2)))
SELECT (IF((SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE delivery_id = #{deliveryId} AND scan_status != 1 AND is_abnormal_loading != 2 AND signfor_state = 2) is null,0,(SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE delivery_id = #{deliveryId} AND scan_status != 1 AND is_abnormal_loading != 2 AND signfor_state = 2)))
+
(IF((SELECT sum(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE delivery_id = #{deliveryId} AND scan_state != 1 AND signfor_state = 2)is null,0,(SELECT sum(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE delivery_id = #{deliveryId} AND scan_state != 1 AND signfor_state = 2)))
(IF((SELECT sum(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE delivery_id = #{deliveryId} AND scan_status != 1 AND signfor_state = 2)is null,0,(SELECT sum(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE delivery_id = #{deliveryId} AND scan_status != 1 AND signfor_state = 2)))
</select>
<select id="selectLoadingNumByDeliveryId" resultType="java.lang.Integer">
SELECT (IF((SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE delivery_id = #{deliveryId} AND scan_state != 1 AND is_abnormal_loading != 2 AND signfor_state = 2) is null,0,(SELECT sum(loaded_nub) FROM logpm_distribution_loadscan WHERE delivery_id = #{deliveryId} AND scan_state != 1 )))

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

@ -47,7 +47,8 @@
lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id = #{deliveryId}
</update>
<update id="updateLnumAndSnumByReservationId">
UPDATE logpm_distribution_signfor lds set lds.loaded_number = ( lds.loaded_number + #{nub1} ),lds.received_quantity = ( lds.received_quantity + #{nub2}
UPDATE logpm_distribution_signfor lds set lds.loaded_number = ( lds.loaded_number + #{nub1}
),lds.received_quantity = ( lds.received_quantity + #{nub2}
) WHERE
lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id = #{deliveryId}
</update>
@ -94,7 +95,8 @@
signee_name is null and delivery_id = #{deliveryId} and reservation_id = #{reservationId}
</update>
<update id="deductionLoadingAndSignforPacjageNum">
UPDATE logpm_distribution_signfor lds set lds.loaded_number = ( lds.loaded_number - #{loadingNum} ),received_quantity = (lds.received_quantity - #{signforNum}) WHERE
UPDATE logpm_distribution_signfor lds set lds.loaded_number = ( lds.loaded_number - #{loadingNum}
),received_quantity = (lds.received_quantity - #{signforNum}) WHERE
lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loaded_number !=0 and lds.delivery_id =
#{deliveryId}
</update>
@ -386,7 +388,8 @@
and ldr.mall_name like concat('%',#{param.mallName},'%')
</if>
<if test="param.ids != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.ids)">and lds.id in
<if test="param.ids != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.ids)">and
lds.id in
<foreach collection="param.ids" separator="," close=")" open="(" item="a">
#{a}
</foreach>
@ -1093,7 +1096,7 @@
ldla.id AS id,
ldla.auditing_status AS auditingStatus,
CASE when ldla.auditing_status = 1 then '待审核'
when ldla.auditing_status = 2 then '已审核'
when ldla.auditing_status = 2 then '已审核'
else '已驳回'
end AS auditingStatusName,
ldla.auditing_time AS auditingTime,
@ -1129,8 +1132,8 @@
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldla.loading_id = ldl.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldla.package_id = ldpl.id
WHERE
ldla.reservation_id = #{reservationId} and ldla.delivery_list_id =
#{deliveryListId} AND ldla.is_deleted = 0
ldla.reservation_id = #{reservationId} and ldla.delivery_list_id =
#{deliveryListId} AND ldla.is_deleted = 0
</select>
<select id="selectSignImgsUrl" resultType="com.logpm.distribution.vo.DistributionSignPrintVO">
SELECT * FROM logpm_distribution_sign_print WHERE reservation_id = #{reservationId} and is_deleted = 0
@ -1683,7 +1686,8 @@
logpm_distribution_loadscaninvn AS ldl
INNER JOIN logpm_distribution_delivery_list AS lddl ON lddl.id = ldl.delivery_id
AND lddl.is_deleted = 0
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND ldpl.warehouse_id = ldl.warehouse_id
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND
ldpl.warehouse_id = ldl.warehouse_id
AND ldpl.is_deleted = 0
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldpl.warehouse_id = lww.id
WHERE
@ -1716,7 +1720,8 @@
logpm_distribution_loadscaninvn AS ldl
INNER JOIN logpm_distribution_delivery_list AS lddl ON lddl.id = ldl.delivery_id
AND lddl.is_deleted = 0
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND ldpl.warehouse_id = ldl.warehouse_id
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND
ldpl.warehouse_id = ldl.warehouse_id
AND ldpl.is_deleted = 0
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldpl.warehouse_id = lww.id
WHERE
@ -1750,7 +1755,8 @@
logpm_distribution_loadscaninvn AS ldl
INNER JOIN logpm_distribution_delivery_list AS lddl ON lddl.id = ldl.delivery_id
AND lddl.is_deleted = 0
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND ldpl.warehouse_id = ldl.warehouse_id
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND
ldpl.warehouse_id = ldl.warehouse_id
AND ldpl.is_deleted = 0
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldpl.warehouse_id = lww.id
WHERE
@ -1784,7 +1790,8 @@
logpm_distribution_loadscaninvn AS ldl
INNER JOIN logpm_distribution_delivery_list AS lddl ON lddl.id = ldl.delivery_id
AND lddl.is_deleted = 0
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND ldpl.warehouse_id = ldl.warehouse_id
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldl.order_package_code = ldpl.order_package_code AND
ldpl.warehouse_id = ldl.warehouse_id
AND ldpl.is_deleted = 0
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldpl.warehouse_id = lww.id
WHERE
@ -1887,7 +1894,7 @@
) orderNumber,
(
SELECT COALESCE
( sum( ldr.reservation_num ), 0 )
( sum( ldr.reservation_num + ldr.reservation_stock_list_num ), 0 )
FROM
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id
@ -1914,7 +1921,8 @@
delivery_id = lddl.id
AND is_deleted = 0
AND scan_status != 1
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND is_deleted = 0 AND scan_status != 1 )
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND
is_deleted = 0 AND scan_status != 1 )
) AS scannedNumber,
((
SELECT
@ -1926,7 +1934,8 @@
AND is_deleted = 0
AND scan_status != 1
AND signfor_state = 2
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND is_deleted = 0 AND scan_status != 1 AND signfor_state = 2)
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND
is_deleted = 0 AND scan_status != 1 AND signfor_state = 2)
) AS signforNumber,
(
SELECT
@ -1973,7 +1982,7 @@
lddl.is_deleted = 0 AND lddl.warehouse_id = #{param.warehouseId}
<if test="deliveryIds != null ">
and lddl.id in
<foreach collection = "deliveryIds" item="item" open="(" close=")" separator=",">
<foreach collection="deliveryIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
@ -1990,9 +1999,10 @@
WHERE
lddl.is_deleted = 0
<if test="param.trainNumber != null and param.trainNumber != ''">
AND lddl.train_number LIKE CONCAT('%', #{param.trainNumber}, '%')
AND lddl.train_number LIKE CONCAT('%', #{param.trainNumber}, '%')
</if>
AND DATE_FORMAT( lddl.task_time, '%y%m%d' ) BETWEEN DATE_FORMAT( #{param.taskTime_start}, '%y%m%d' ) AND DATE_FORMAT( #{param.taskTime_end}, '%y%m%d' )
AND DATE_FORMAT( lddl.task_time, '%y%m%d' ) BETWEEN DATE_FORMAT( #{param.taskTime_start}, '%y%m%d' ) AND
DATE_FORMAT( #{param.taskTime_end}, '%y%m%d' )
AND lddl.warehouse_id = #{param.warehouseId}
</select>
<select id="selectNewAppDistributionDetail"
@ -2045,7 +2055,8 @@
delivery_id = lddl.id
AND is_deleted = 0
AND scan_status != 1
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND is_deleted = 0 AND scan_status != 1 )
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND
is_deleted = 0 AND scan_status != 1 )
) AS loadingNumber,
((
SELECT
@ -2057,7 +2068,8 @@
AND is_deleted = 0
AND scan_status != 1
AND signfor_state = 2
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND is_deleted = 0 AND scan_status != 1 AND signfor_state = 2 )
) + ( SELECT IFNUll( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE delivery_id = lddl.id AND
is_deleted = 0 AND scan_status != 1 AND signfor_state = 2 )
) AS signforNumber,
CASE lddl.delivery_status
WHEN '1' THEN '待配送'
@ -2085,16 +2097,16 @@
LEFT JOIN logpm_distribution_delivery_self ldds ON lddl.id = ldds.delivery_id
WHERE
lddl.is_deleted = 0
AND lddl.id = #{deliveryId}
AND lddl.id = #{deliveryId}
</select>
<select id="selectNewAppCustomList"
resultType="com.logpm.distribution.vo.app.DistributionAppNewReservationVO">
SELECT
ldr.id id,
GROUP_CONCAT( DISTINCT CONCAT( ldr.receiving_unit, '(', ldr.consignee ), ')' ) AS consignee,
ldr.delivery_phone AS phone,
ldr.delivery_address AS address,
ldr.remarks AS remarks,
ldr.delivery_phone AS phone,
ldr.delivery_address AS address,
ldr.remarks AS remarks,
COALESCE ( ldr.reservation_num + ldr.reservation_stock_list_num, 0 ) planNumber,
(
SELECT COALESCE
@ -2105,9 +2117,16 @@
ldrs.reservation_id = ldr.id
AND ldrs.stock_article_status IN ( 1, 3 )
) orderNumber,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ), 0 ) AS loadingQuantity,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 AND signfor_state = 2), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 AND signfor_state = 2 ), 0 ) AS signforQuantity,
( SELECT IFNULL( GROUP_CONCAT( stockup_area ), '无备货区' ) FROM logpm_distribution_stock WHERE reservation_id = ldr.id AND is_deleted = 0 ) AS stockupArea,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND
is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM
logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted =
0 ), 0 ) AS loadingQuantity,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND
is_deleted = 0 AND scan_status != 1 AND signfor_state = 2), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM
logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted =
0 AND signfor_state = 2 ), 0 ) AS signforQuantity,
( SELECT IFNULL( GROUP_CONCAT( stockup_area ), '无备货区' ) FROM logpm_distribution_stock WHERE reservation_id =
ldr.id AND is_deleted = 0 ) AS stockupArea,
IF
((
ldr.reservation_num + ldr.reservation_stock_list_num
@ -2132,9 +2151,9 @@
SELECT
ldr.id id,
GROUP_CONCAT( DISTINCT CONCAT( ldr.receiving_unit, '(', ldr.consignee ), ')' ) AS consignee,
ldr.delivery_phone AS phone,
ldr.delivery_address AS address,
ldr.remarks AS remarks,
ldr.delivery_phone AS phone,
ldr.delivery_address AS address,
ldr.remarks AS remarks,
COALESCE ( ldr.reservation_num + ldr.reservation_stock_list_num, 0 ) planNumber,
(
SELECT COALESCE
@ -2145,9 +2164,16 @@
ldrs.reservation_id = ldr.id
AND ldrs.stock_article_status IN ( 1, 3 )
) orderNumber,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ), 0 ) AS loadingQuantity,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 AND signfor_state = 2), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 AND signfor_state = 2 ), 0 ) AS signforQuantity,
( SELECT IFNULL( GROUP_CONCAT( stockup_area ), '无备货区' ) FROM logpm_distribution_stock WHERE reservation_id = ldr.id AND is_deleted = 0 ) AS stockupArea,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND
is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM
logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted =
0 ), 0 ) AS loadingQuantity,
IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND
is_deleted = 0 AND scan_status != 1 AND signfor_state = 2), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM
logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted =
0 AND signfor_state = 2 ), 0 ) AS signforQuantity,
( SELECT IFNULL( GROUP_CONCAT( stockup_area ), '无备货区' ) FROM logpm_distribution_stock WHERE reservation_id =
ldr.id AND is_deleted = 0 ) AS stockupArea,
IF
((
ldr.reservation_num + ldr.reservation_stock_list_num
@ -2169,16 +2195,15 @@
SELECT
ldsl.id id,
ldsl.sku sku,
ldsld.stock_locking_status sku,
CASE ldsld.stock_signfo_status
WHEN '10' THEN '待签收'
WHEN '20' THEN '已签收'
WHEN '10' THEN '待签收'
WHEN '20' THEN '已签收'
ELSE
'未知'
END signingStatusName,
CASE ldsld.stock_locking_status
WHEN '10' THEN '待装车'
WHEN '20' THEN '已装车'
WHEN '10' THEN '待装车'
WHEN '20' THEN '已装车'
ELSE
'未知'
END loadingStatusName,
@ -2258,7 +2283,7 @@
ldpl.order_package_reservation_status AS orderPackageReservationStatus,
ldpl.order_package_loading_status AS orderPackageLoadingStatus,
ldpl.material_name AS materialName,
ldpl.id AS packageId,
ldla.package_id AS packageId,
CASE
ldla.abnormal_type
WHEN 1 THEN

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

@ -57,4 +57,13 @@ public interface IDistributionLoadscanAbnormalService extends BaseService<Distri
* @param reservationId
*/
void completeLoadingAbnormal(String orderPackageCode, Long warehouseId, Long reservationId,String username);
/**
* 查询是否存在有异常装车和签收数据
* @param reservationId
* @param deliveryId
* @param warehouseId
* @return
*/
boolean isHaveAbnormalPackage(Long reservationId, Long deliveryId, Long warehouseId);
}

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

@ -2070,7 +2070,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
distributionLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscaninvnEntity.setScanType("1");
distributionLoadscaninvnEntity.setScanUser(user.getUserName());
distributionLoadscaninvnEntity.setScanUser(user.getNickName());
distributionLoadscaninvnEntity.setScanTime(now);
distributionLoadscaninvnEntity.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode());
distributionLoadscaninvnEntity.setInventoryId(disStockListDetailEntity.getStockListId());
@ -8070,7 +8070,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.fail(403, "未授权!!!");
}
//查询是否存在签收数据
Integer signingNum = distributionLoadscanMapper.selectSigningNumByReservationId(distrilbutionloadingscanDTO.getReservationId());
Integer signingNum = distributionLoadscanMapper.selectSigningNumByDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
if (signingNum > 0){
return Resp.scanFail("当前车次存在签收数据","当前车次存在签收数据");
}
@ -9014,6 +9014,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = getDistributionLoadscaninvnEntity(distrilbutionloadingscanDTO, distributionDeliverySelfEntity, disStockListDetailEntity, myCurrentWarehouse);
packageLockIds.add(distributionLoadscaninvnEntity.getInventoryPackageId());
distributionLoadscaninvnService.save(distributionLoadscaninvnEntity);
//对装车异常进行关闭
distributionLoadscanAbnormalService.completeLoadingAbnormal(distributionLoadscaninvnEntity.getOrderPackageCode(), distributionLoadscaninvnEntity.getWarehouseId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getScanUser());
//这里还需要对异常记录进行关闭和完成
//查询本车次是否第一次扫码,没有则更新上车时间
distributionDeliveryListMapper.updateloadingTimeById(distributionLoadscaninvnEntity.getDeliveryId());
//更新签收表的装车数量
@ -9317,6 +9320,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscanAbnormalEntity.setPackageId(parcelListEntity.getId());
distributionLoadscanAbnormalEntity.setLoadingId(distributionLoadscanEntity.getId());
distributionLoadscanAbnormalEntity.setGoodsType(1);
distributionLoadscanAbnormalEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionLoadscanAbnormalEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionLoadscanAbnormalEntity.setAbnormalType(LoadingAbnormalTypeConstant.jihuayichang.getValue());
orderPackageCodes.add(distributionLoadscanEntity.getOrderPackageCode());
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity);
@ -9492,8 +9497,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
//进行批量取消异常并且取消计划
return cancelLoadscanAbnormalEntity(abnormalEntities, reservationId, deliveryId, myCurrentWarehouseAndConfig.getId());
}
@ -9766,6 +9769,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!inventoryPackageIds.isEmpty()) {
DistributionCancelReservationPackageDTO distributionCancelReservationPackageDTO = new DistributionCancelReservationPackageDTO();
distributionCancelReservationPackageDTO.setInventoryPackageIds(inventoryPackageIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
distributionCancelReservationPackageDTO.setPackageIds(inventoryPackageIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
distributionCancelReservationPackageDTO.setType(2);
distributionCancelReservationPackageDTO.setReservationId(reservationId);
distributionCancelReservationPackageDTO.setDeliveryId(deliveryId);
@ -10042,11 +10046,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (shangpeiFlag) {
//查看是否存在满足条件的预约单
boolean flag = reservationEntityList.stream().anyMatch(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(reservationId));
boolean flag = reservationEntityList.stream().anyMatch(r -> Func.isNotEmpty(r.getConsignee())
&& r.getConsignee().equals(stockArticleEntity.getCustomerName())
&& r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress())
&& r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone())
&& r.getMallName().equals(stockArticleEntity.getMallName()));
//存在多个,操作人指定具体客户即可
if (flag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(reservationId)).collect(Collectors.toList());
return true;
} else {
return false;
@ -10057,7 +10064,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询是否满足商配异常装车
boolean flag = reservationEntityList.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (flag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(reservationId)).collect(Collectors.toList());
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee())
&& r.getConsignee().equals(stockArticleEntity.getCustomerName())
&& r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress())
&& r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone())
&& r.getMallName().equals(stockArticleEntity.getMallName())
).collect(Collectors.toList());
return true;
} else {
return false;

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

@ -61,4 +61,9 @@ public class DistributionLoadscanAbnormalServiceImpl extends BaseServiceImpl<Dis
baseMapper.completeLoadingAbnormal(orderPackageCode,warehouseId,reservationId,username);
}
@Override
public boolean isHaveAbnormalPackage(Long reservationId, Long deliveryId, Long warehouseId) {
return baseMapper.isHaveAbnormalPackage(reservationId,deliveryId,warehouseId) == 0;
}
}

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

@ -1431,6 +1431,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Override
@Transactional
public boolean maintainInWarehouse(Long orderPackageId) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
DistributionParcelListEntity parcelListEntity = this.getById(orderPackageId);
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiruku.getValue());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue());
@ -1438,6 +1439,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
boolean update = this.updateById(parcelListEntity);
//维护订单
distributionStockArticleService.maintenanceOrderMall(parcelListEntity.getStockArticleId()+"");
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"扫描回库,回库原因:"+"异常拒签";
//进行日志添加
List<JSONObject> logList = new ArrayList<>();
JSONObject logJS = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_FAIL.getCode());
logList.add(logJS);
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
return update;
}

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

@ -3857,19 +3857,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail(403, "未授权!!!");
}
if (Func.isEmpty(distributionCancelReservationPackageDTO.getPackageIds())) {
log.error(method + "packageId参数缺失");
return R.fail("请联系管理员....");
}
DistributionReservationEntity reservationEntity = this.getById(distributionCancelReservationPackageDTO.getReservationId());
if (Func.isEmpty(reservationEntity)) {
log.error(method + "查询预约计划信息错误>>>>>>>>>>>>>>>>>>reservationId:{}", distributionCancelReservationPackageDTO.getReservationId());
return R.fail("请联系管理员....");
}
if (Func.isEmpty(distributionCancelReservationPackageDTO.getPackageIds())) {
log.error(method + "packageId参数缺失");
return R.fail("请联系管理员....");
}
List<Long> list = Func.toLongList(distributionCancelReservationPackageDTO.getPackageIds());
log.info(method + "取消包件>>>>:{}", distributionCancelReservationPackageDTO.getPackageIds());
switch (distributionCancelReservationPackageDTO.getType()) {
case 1:
//取消包件
String[] split = distributionCancelReservationPackageDTO.getPackageIds().split(",");
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionCancelReservationPackageDTO.getReservationId());

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

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save