Browse Source

零担回库

dist.1.3.0
汤建军 6 months ago
parent
commit
479204640d
  1. 3
      blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalAuditingStatusConstant.java
  2. 3
      blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingAbnormalTypeConstant.java
  3. 121
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPositioningEntity.java
  4. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  5. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionLoadscanAbnormalClient.java
  6. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java
  7. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  8. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionLoadscanAbnormalClient.java
  9. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java
  10. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPositioningMapper.java
  11. 101
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPositioningMapper.xml
  12. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  13. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  14. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  15. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionLoadscanService.java
  16. 39
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionPositioningService.java
  17. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationZeroPackageService.java
  18. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  19. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionLoadscanServiceImpl.java
  20. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPositioningServiceImpl.java
  21. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java
  22. 69
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  23. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java
  24. 29
      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/LoadingAbnormalAuditingStatusConstant.java

@ -10,7 +10,8 @@ public enum LoadingAbnormalAuditingStatusConstant {
daishenhe("待审核",1),
yishenhe("已审核",2),
yichang("已驳回",3),
yiquxiao("已取消",4);
yiquxiao("已取消",4),
yiqueding("已确定",5);
/**

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

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

121
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPositioningEntity.java

@ -0,0 +1,121 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* 自主配送信息列表 实体类
*
* @author Tjj
* @since 2023-07-04
*/
@Data
@TableName("logpm_distribution_positioning")
@ApiModel(value = "DistributionPositioning对象", description = "自主配送信息列表")
@EqualsAndHashCode(callSuper = true)
public class DistributionPositioningEntity extends TenantEntity {
/**
* 配送司机
*/
@ApiModelProperty(value = "配送司机")
private String driverId;
/**
* 车辆编号
*/
@ApiModelProperty(value = "车辆编号")
private Long vehicleId;
/**
* 配送ID
*/
@ApiModelProperty(value = "配送ID")
private Long deliveryId;
/**
* 预约ID
*/
@ApiModelProperty(value = "预约ID")
private Long reservationId;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
private String vehicleNumber;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
private String operationUsername;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
private Long operationId;
/**
* 地址
*/
@ApiModelProperty(value = "地址")
private String address;
/**
* 经纬度
*/
@ApiModelProperty(value = "经纬度")
private String latitudeAndLongitude;
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
}

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

@ -144,7 +144,13 @@ public interface IDistributionDeliveryListClient {
* @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);
boolean retentionReservationZeroPackageByNum(@RequestParam("deliveryId")Long deliveryId,
@RequestParam("reservationId") Long reservationId,
@RequestParam("orderPackageId") Long orderPackageId,
@RequestParam("retentionQuantity") Integer retentionQuantity,
@RequestParam("orderId") Long orderId,
@RequestParam("loadingId") Long loadingId
);
// /**

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

@ -21,6 +21,8 @@ import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
@ -49,4 +51,8 @@ public interface IDistributionLoadscanAbnormalClient {
@GetMapping(TOP+"completeAbnormal")
void completeAbnormal(@RequestParam("abnormalId")Long abnormalId);
@PostMapping(TOP+"saveDistributionLoadscanAbnormalEntity")
Long saveDistributionLoadscanAbnormalEntity(@RequestBody DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity);
}

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java

@ -42,6 +42,7 @@ public interface IDistributionSignforClient {
String CLERKCHECKPUSHDATA = API_PREFIX + "/clerkCheckPushData";
String CLERKINVENTORYCHECKDATA = API_PREFIX + "/clerkInventoryCheckPushData";
String MAINTAINISHAVEABNORMALPACKAGE = API_PREFIX + "/maintainIsHaveAbnormalPackage";
String UPDATEISHAVEABNORMALPACKAGE = API_PREFIX + "/updateIsHaveAbnormalPackage";
/**
* 获取签收管理列表
@ -84,4 +85,11 @@ public interface IDistributionSignforClient {
*/
@GetMapping(MAINTAINISHAVEABNORMALPACKAGE)
void maintainIsHaveAbnormalPackage(@RequestParam("reservationId")Long reservationId);
/**
* 进行签收异常标注
* @param reservationId
*/
@GetMapping(UPDATEISHAVEABNORMALPACKAGE)
void updateIsHaveAbnormalPackage(@RequestParam("reservationId")Long reservationId);
}

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

@ -139,8 +139,15 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
}
@Override
public boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId) {
return distributionDeliveryListService.retentionReservationZeroPackageByNum(deliveryId,reservationId,orderPackageId,retentionQuantity,orderId);
public boolean retentionReservationZeroPackageByNum(Long deliveryId,
Long reservationId,
Long orderPackageId,
Integer retentionQuantity,
Long orderId,
Long loadingId
)
{
return distributionDeliveryListService.retentionReservationZeroPackageByNum(deliveryId,reservationId,orderPackageId,retentionQuantity,orderId,loadingId);
}

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

@ -62,4 +62,10 @@ public class DistributionLoadscanAbnormalClient implements IDistributionLoadscan
}
@Override
public Long saveDistributionLoadscanAbnormalEntity(DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity) {
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity);
return distributionLoadscanAbnormalEntity.getId();
}
}

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

@ -129,6 +129,14 @@ public class DistributionSignforClient implements IDistributionSignforClient {
distributionSignforService.maintainIsHaveAbnormalPackage(reservationId);
}
@Override
public void updateIsHaveAbnormalPackage(Long reservationId) {
distributionSignforService.update(Wrappers.<DistributionSignforEntity>update().lambda()
.eq(DistributionSignforEntity::getReservationId,reservationId)
.set(DistributionSignforEntity::getIsHaveAbnormalPackage,2)
);
}
private void buildNameAndPhone(List<SignPushDataUnitDTO> pushOldPackageSigning) {
for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) {

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPositioningMapper.java

@ -0,0 +1,41 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.entity.DistributionPositioningEntity;
import com.logpm.distribution.excel.DistributionDeliverySelfExcel;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.vo.app.DistributionAppDeliverySelfVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自主配送信息列表 Mapper 接口
*
* @author Tjj
* @since 2023-07-04
*/
public interface DistributionPositioningMapper extends BaseMapper<DistributionPositioningEntity> {
}

101
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPositioningMapper.xml

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.distribution.mapper.DistributionPositioningMapper">
<!-- 通用查询映射结果 -->
<resultMap id="distributionDeliverySelfResultMap" type="com.logpm.distribution.entity.DistributionPositioningEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="reservation_id" property="reservationId"/>
<result column="vehicle_id" property="vehicleId"/>
<result column="delivery_id" property="deliveryId"/>
<result column="vehicle_number" property="vehicleNumber"/>
<result column="operation_username" property="operationUsername"/>
<result column="operation_id" property="operationId"/>
<result column="address" property="address"/>
<result column="address" property="address"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
</resultMap>
<delete id="deleteDeliverySelf">
DELETE FROM logpm_distribution_delivery_self WHERE delivery_id = #{id}
</delete>
<select id="selectDistributionDeliverySelfPage" resultMap="distributionDeliverySelfResultMap">
select * from logpm_distribution_delivery_self where is_deleted = 0
</select>
<select id="exportDistributionDeliverySelf" resultType="com.logpm.distribution.excel.DistributionDeliverySelfExcel">
SELECT * FROM logpm_distribution_delivery_self ${ew.customSqlSegment}
</select>
<select id="getDeliverySelfInfo" resultType="com.logpm.distribution.vo.DistributionDeliverySelfVO">
SELECT
ldds.*
FROM
logpm_distribution_delivery_list AS lddl
INNER JOIN logpm_distribution_delivery_self AS ldds ON lddl.id=ldds.delivery_id
<where>
<if test="id != null and id != ''">
and lddl.id=#{id}
</if>
</where>
</select>
<select id="selectListcustom" resultType="com.logpm.distribution.vo.app.DistributionAppDeliverySelfVO">
select id id,driver_id driverId, vehicle_id vehicleId,is_master isMaster,driver_name driverName,vehicle_nub vehicleNub
FROM logpm_distribution_delivery_self
where delivery_id = #{deliveryId}
</select>
<select id="selectdeliveryList" resultType="java.lang.Long">
SELECT
ldds.delivery_id
FROM
logpm_distribution_delivery_self ldds
LEFT JOIN logpm_distribution_delivery_list lddl ON lddl.id = ldds.delivery_id
WHERE
ldds.driver_id = #{id}
AND lddl.delivery_status != 3
</select>
<select id="selectNewDeliveryList" resultType="java.lang.Long">
SELECT
lddl.id
FROM
logpm_distribution_delivery_self AS ldds
LEFT JOIN logpm_distribution_delivery_list AS lddl ON ldds.delivery_id = lddl.id
WHERE
ldds.is_deleted = 0
AND lddl.is_deleted = 0
<if test="param.trainNumber != null and 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 ldds.driver_id = #{param.driverId}
AND lddl.delivery_status != 3
AND lddl.warehouse_id = #{param.warehouseId}
</select>
<select id="selectByDeliveyId" resultType="com.logpm.distribution.entity.DistributionDeliverySelfEntity">
SELECT * FROM logpm_distribution_delivery_self WHERE delivery_id = #{deliveryId} AND is_master = 2
</select>
<select id="selectDriverInfoByDeliveryIdAndDriverId"
resultType="com.logpm.distribution.entity.DistributionDeliverySelfEntity">
SELECT * FROM logpm_distribution_delivery_self WHERE driver_id = #{driverId} AND delivery_id = #{deliveryId} AND is_deleted = 0
</select>
<select id="selectDriverInfoByDeliveryIdAndVehicleNub"
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>
</mapper>

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

@ -2212,7 +2212,9 @@
WHEN 3 THEN
'已驳回'
WHEN 4 THEN
'已取消' ELSE '未知'
'已取消'
WHEN 5 THEN
'已确认' ELSE '未知'
END AS auditingStatusName,
CASE
ldla.complete
@ -2256,7 +2258,10 @@
WHEN 3 THEN
'签收异常'
WHEN 4 THEN
'异常拒签' ELSE '未知'
'异常拒签'
WHEN 5 THEN
'自主回库'
ELSE '未知'
END abnormalTypeName
FROM
logpm_distribution_loadscan_abnormal AS ldla

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

@ -82,7 +82,6 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
/**
* 查询二维码包件数据
* @param qrCode
* @param o
* @return
*/
DistributionStockArticleQRCodeVO getOrderNoList(@Param("qrCode") String qrCode, @Param("o") String id);

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

@ -566,7 +566,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param orderId
* @return
*/
boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId);
boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId, Long loadingId);
/**
* 是否可以发车

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

@ -56,4 +56,11 @@ public interface IDistributionLoadscanService extends BaseService<DistributionLo
* @return
*/
String selectDriverNameByOrderId(Long id);
/**
* 扣减指定的装车数量
* @param retentionQuantity
* @param loadingId
*/
void deductionLoadingNum(Integer retentionQuantity, Long loadingId);
}

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

@ -0,0 +1,39 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.entity.DistributionPositioningEntity;
import com.logpm.distribution.excel.DistributionDeliverySelfExcel;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import org.springblade.core.mp.base.BaseService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 自主配送信息列表 服务类
*
* @author Tjj
* @since 2023-07-04
*/
public interface IDistributionPositioningService extends BaseService<DistributionPositioningEntity> {
}

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

@ -87,5 +87,5 @@ public interface IDistributionReservationZeroPackageService extends BaseService<
* @param orderPackageId
* @param retentionQuantity
*/
void reduceNum(Long reservationId, Long orderId, Long orderPackageId, Integer retentionQuantity);
void reduceNum(Long reservationId, Long orderId, Long orderPackageId, Integer retentionQuantity,Long loadingId);
}

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

@ -4654,7 +4654,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Boolean b = false;
Boolean isEnd = false;
//防止司机进行重复发车点击
Long isRepeat = bladeRedis.get(AuthUtil.getTenantId() + ":warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:");
Long isRepeat = bladeRedis.get(AuthUtil.getTenantId() + ":warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + ":driverId:");
if (Func.isNotEmpty(isRepeat)) {
return Resp.scanFail("请勿重复发车", "请勿重复发车");
}
@ -4678,7 +4678,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
contrastPlanAndLoading(distributionDeliveryListEntity, myCurrentWarehouse);
//进行发车日志记录
}
bladeRedis.setEx(AuthUtil.getTenantId() + ":warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:", user.getUserId(), 60L * 30L);
bladeRedis.setEx(AuthUtil.getTenantId() + ":warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + ":driverId:", user.getUserId(), 60L * 30L);
//修改主表状态
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
baseMapper.updateById(distributionDeliveryListEntity);
@ -9582,14 +9582,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
@Transactional
public boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId) {
public boolean retentionReservationZeroPackageByNum(Long deliveryId, Long reservationId, Long orderPackageId, Integer retentionQuantity, Long orderId, Long loadingId) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
return false;
}
List<Long> ids = new ArrayList<>();
ids.add(orderId);
distributionReservationZeroPackageService.reduceNum(reservationId,orderId,orderPackageId,retentionQuantity);
distributionReservationZeroPackageService.reduceNum(reservationId,orderId,orderPackageId,retentionQuantity,loadingId);
distributionStockArticleService.maintenanceOrderInfoByIds(ids);
distributionParcelListService.maintenanceZerpPackageInfo(orderPackageId);
distributionParcelListService.maintenanceZerpPackageInfo(orderPackageId);
@ -9626,17 +9626,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
boolean flag = judgeIsStart(distributionDeliveryListEntity, myCurrentWarehouse);
return Resp.status(flag);
return Resp.data(flag);
}
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.setConditions(2);
packageRetentionScanEntity.setRetentionQuantity(loadscanEntity.getPackageNub() - loadscanEntity.getReceivedQuantity());
packageRetentionScanEntity.setOrderPackageId(loadscanEntity.getPackageId());
//查询包件

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

@ -57,4 +57,12 @@ public class DistributionLoadscanServiceImpl extends BaseServiceImpl<Distributio
return baseMapper.selectDriverNameByOrderId(id);
}
@Override
public void deductionLoadingNum(Integer retentionQuantity, Long loadingId) {
DistributionLoadscanEntity loadscanEntity = this.getById(loadingId);
loadscanEntity.setLoadedNub(loadscanEntity.getLoadedNub() - retentionQuantity);
loadscanEntity.setPackageNub(loadscanEntity.getPackageNub() - retentionQuantity);
this.updateById(loadscanEntity);
}
}

44
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPositioningServiceImpl.java

@ -0,0 +1,44 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.entity.DistributionPositioningEntity;
import com.logpm.distribution.excel.DistributionDeliverySelfExcel;
import com.logpm.distribution.mapper.DistributionDeliverySelfMapper;
import com.logpm.distribution.mapper.DistributionPositioningMapper;
import com.logpm.distribution.service.IDistributionDeliverySelfService;
import com.logpm.distribution.service.IDistributionPositioningService;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 自主配送信息列表 服务实现类
*
* @author Tjj
* @since 2023-07-04
*/
@Service
public class DistributionPositioningServiceImpl extends BaseServiceImpl<DistributionPositioningMapper, DistributionPositioningEntity> implements IDistributionPositioningService {
}

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

@ -62,6 +62,10 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
@Lazy
private IDistributionReservationStockarticleService distributionReservationStockarticleService;
@Autowired
@Lazy
private IDistributionLoadscanService distributionLoadscanService;
@Override
public IPage<DistributionReservationZeroPackageVO> selectDistributionReservationZeroPackagePage(IPage<DistributionReservationZeroPackageVO> page, DistributionReservationZeroPackageVO distributionReservationZeroPackage) {
@ -160,7 +164,7 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
@Override
@Transactional
public void reduceNum(Long reservationId, Long orderId, Long orderPackageId, Integer retentionQuantity) {
public void reduceNum(Long reservationId, Long orderId, Long orderPackageId, Integer retentionQuantity,Long loadingId) {
DistributionReservationZeroPackageEntity one = this.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, orderId)
@ -183,6 +187,10 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
distributionParcelNumberEntity.setOutboundQuantity(outboundQuantity);
distributionParcelNumberEntity.setHandQuantity(handQuantity);
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
//对指定的装车记录进行扣减
distributionLoadscanService.deductionLoadingNum(retentionQuantity,loadingId);
}
}

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

@ -270,6 +270,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IBasicCarModelClient iBasicCarModelClient;
@Autowired
private IDistributionPositioningService distributionPositioningService;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -4741,29 +4744,42 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId())
.eq(DistributionSignforEntity::getDeliveryId, distributionSignfor.getDeliveryId())
);
if (null != distributionSignforEntity.getPositioning() || null != distributionSignforEntity.getPositioningAdr()) {
return Resp.scanSuccess("已打卡", "已打卡");
}
BladeUser user = AuthUtil.getUser();
Boolean driver = distributionDeliveryListService.judgeIsDriver(user);
String positioning = distributionSignfor.getPositioning();
GAddressVo add = GaoDeApiUtil.getAdd(positioning);
boolean update = this.update(new UpdateWrapper<DistributionSignforEntity>().lambda()
.eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId())
.eq(DistributionSignforEntity::getDeliveryId, distributionSignfor.getDeliveryId())
.set(StringUtils.isNotBlank(distributionSignfor.getPositioning()), DistributionSignforEntity::getPositioning, distributionSignfor.getPositioning())
.set(StringUtils.isNotBlank(add.getAddress()), DistributionSignforEntity::getPositioningAdr, add.getAddress())
);
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distributionSignforEntity.getDeliveryId());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distributionSignforEntity.getReservationId());
BladeUser user = AuthUtil.getUser();
DistributionPositioningEntity distributionPositioning = createdDistributionPositioningEntity(deliveryListEntity,reservationEntity,AuthUtil.getUser(),driver,positioning);
//进行打卡信息保存
distributionPositioningService.save(distributionPositioning);
NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg = buildConsigneeArriveVO(deliveryListEntity, reservationEntity, add, user);
iDistributionNodeWorkService.carArrived(nodeFanoutMsg, user);
return Resp.scanSuccess("打卡成功", "打卡成功");
}
private DistributionPositioningEntity createdDistributionPositioningEntity(DistributionDeliveryListEntity deliveryListEntity,
DistributionReservationEntity reservationEntity,
BladeUser user,
Boolean driver,
String positioning) {
GAddressVo add = GaoDeApiUtil.getAdd(positioning);
DistributionPositioningEntity distributionPositioningEntity = new DistributionPositioningEntity();
distributionPositioningEntity.setAddress(positioning);
distributionPositioningEntity.setLatitudeAndLongitude(add.getAddress());
distributionPositioningEntity.setDeliveryId(deliveryListEntity.getId());
distributionPositioningEntity.setReservationId(reservationEntity.getId());
distributionPositioningEntity.setOperationUsername(user.getNickName());
distributionPositioningEntity.setOperationId(user.getUserId());
if ("1".equals(deliveryListEntity.getKind())){
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliveryListService.getDriver(deliveryListEntity, user, null, driver);
distributionPositioningEntity.setVehicleNumber(deliverySelfEntity.getVehicleNub());
distributionPositioningEntity.setVehicleId(Long.parseLong(deliverySelfEntity.getVehicleId()));
}
return distributionPositioningEntity;
}
private NodeFanoutMsg<ConsigneeArriveVO> buildConsigneeArriveVO(DistributionDeliveryListEntity deliveryListEntity, DistributionReservationEntity reservationEntity, GAddressVo add, BladeUser user) {
NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg = new NodeFanoutMsg();
@ -7570,6 +7586,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error(method + "Barcode参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
//校验当前包件是否存在回库任务
boolean isHaveRetention = warehouseRetentionScanClient.judgeIsHaveRetention(distrilbutionloadingscanDTO.getBarcode(),myCurrentWarehouse.getId());
if (isHaveRetention){
return Resp.scanFail("当前包件存在回库任务","当前包件存在回库任务");
}
barcode = distrilbutionloadingscanDTO.getBarcode();
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (Objects.isNull(parcelListEntity)) {
@ -7585,12 +7606,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
return Resp.scanFail("包件已签收", "包件已签收");
}
List<JSONObject> aaa = new ArrayList<>();
DistributionReservationPackageEntity planPackage = distributionReservationPackageService.getPlanPackageByReservationAndCode(reservationId,barcode);
if (!Objects.isNull(planPackage)){
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
return Resp.scanFail("包件已签收", "包件已签收");
return Resp.scanFail("包件未装车", "包件未装车");
}
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, barcode)
@ -7660,6 +7680,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//判断客户
boolean flag = judgmentClient(reservationEntity, parcelListEntity.getStockArticleId());
if (flag) {
if (OrderPackageReservationStatusConstant.yiyueyue.getValue().equals(parcelListEntity.getOrderPackageReservationStatus())){
return Resp.scanFail("当前包件存在配送计划", "当前包件存在配送计划");
}
return R.fail(3006, null);
} else {
//查询出未审核如果存在多个则不行
@ -7875,7 +7898,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error(method + "Barcode参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
//校验当前包件是否存在回库任务
boolean isHaveInventoryRetention = warehouseRetentionScanClient.judgeIsHaveRetention(distrilbutionloadingscanDTO.getBarcode(),myCurrentWarehouse.getId());
if (isHaveInventoryRetention){
return Resp.scanFail("当前包件存在回库任务","当前包件存在回库任务");
}
//库存品
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId());
if (detailEntities.isEmpty()) {
@ -8509,6 +8536,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!isDriverFlag) {
return Resp.scanFail("此操作只能司机完成","此操作只能司机完成");
}
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliveryListService.getDriver(deliveryListEntity, user, null, isDriverFlag);
List<JSONObject> logList = new ArrayList<>();
//生成异常
@ -8519,7 +8550,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanAbnormalEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionLoadscanAbnormalEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionLoadscanAbnormalEntity.setReservationId(reservationEntity.getId());
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue());
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.yiqueding.getValue());
distributionLoadscanAbnormalEntity.setGoodsType(1);
distributionLoadscanAbnormalEntity.setPackageId(parcelListEntity.getId());
distributionLoadscanAbnormalEntity.setStockArticleId(parcelListEntity.getStockArticleId());
@ -8537,7 +8568,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//生成回库
createdRefuseSignfor(myCurrentWarehouse,deliveryListEntity,reservationEntity,deliverySelfEntity,parcelListEntity,distributionLoadscanAbnormalEntity.getId());
//记录当前包件生成待回库任务
String content = "包件在" + myCurrentWarehouse.getName() + "由" + user.getNickName() + "异常签收拒签生成待回库任务,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
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()) {

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

@ -461,7 +461,12 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
break;
case 2:
//回库指定数量的零担包件
saveFlah.set(distributionDeliveryListClient.retentionReservationZeroPackageByNum(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId()));
saveFlah.set(distributionDeliveryListClient.retentionReservationZeroPackageByNum(warehouseRetentionScanEntity.getDeliveryId(),
warehouseRetentionScanEntity.getReservationId(),
warehouseRetentionScanEntity.getOrderPackageId(),
warehouseRetentionScanEntity.getRetentionQuantity(),
warehouseRetentionScanEntity.getOrderId(),
warehouseRetentionScanEntity.getLoadingId()));
break;
case 3:
//库存品

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

@ -19,8 +19,11 @@ package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity;
import com.logpm.distribution.entity.DistributionRetentionScanEntity;
import com.logpm.distribution.feign.IDistributionLoadscanAbnormalClient;
import com.logpm.distribution.feign.IDistributionReservationClient;
import com.logpm.distribution.feign.IDistributionSignforClient;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
@ -36,6 +39,8 @@ import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant;
import org.springblade.common.constant.loading.LoadingAbnormalTypeConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@ -66,6 +71,10 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl<Warehouse
private IDistributionReservationClient reservationClient;
private IDistributionSignforClient distributionSignforClient;
private IDistributionLoadscanAbnormalClient distributionLoadscanAbnormalClient;
// private IWarehouseRetentionRecordService retentionRecordService;
@Override
@ -131,8 +140,28 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl<Warehouse
@Override
public R saveEntity(WarehouseRetentionScanEntity warehouseRetentionScan) {
//进行异常新增
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity();
distributionLoadscanAbnormalEntity.setDeliveryListId(warehouseRetentionScan.getDeliveryId());
distributionLoadscanAbnormalEntity.setReservationId(warehouseRetentionScan.getReservationId());
distributionLoadscanAbnormalEntity.setPackageId(warehouseRetentionScan.getOrderPackageId());
distributionLoadscanAbnormalEntity.setPackageCode(warehouseRetentionScan.getOrderPackageCode());
distributionLoadscanAbnormalEntity.setStockArticleId(warehouseRetentionScan.getOrderId());
distributionLoadscanAbnormalEntity.setWarehouseId(warehouseRetentionScan.getWarehouseId());
distributionLoadscanAbnormalEntity.setWarehouseName(warehouseRetentionScan.getWarehouseName());
distributionLoadscanAbnormalEntity.setGoodsType(warehouseRetentionScan.getConditions());
distributionLoadscanAbnormalEntity.setLoadingQuantity(warehouseRetentionScan.getRetentionQuantity());
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.yiqueding.getValue());
distributionLoadscanAbnormalEntity.setDeliveryType(warehouseRetentionScan.getDeliveryType()+"");
distributionLoadscanAbnormalEntity.setAuditingUser(AuthUtil.getNickName());
distributionLoadscanAbnormalEntity.setAuditingTime(new Date());
distributionLoadscanAbnormalEntity.setTrainNumber(warehouseRetentionScan.getTrainNumber());
distributionLoadscanAbnormalEntity.setAbnormalType(LoadingAbnormalTypeConstant.zizhuhuiku.getValue());
Long abnormalId = distributionLoadscanAbnormalClient.saveDistributionLoadscanAbnormalEntity(distributionLoadscanAbnormalEntity);
warehouseRetentionScan.setTaskCode(reservationClient.getRetentionMa());
warehouseRetentionScan.setAbnormalId(abnormalId);
this.save(warehouseRetentionScan);
distributionSignforClient.updateIsHaveAbnormalPackage(warehouseRetentionScan.getReservationId());
return R.success("操作成功");
}

Loading…
Cancel
Save