Browse Source

Merge branch 'dev' into pre-production

master
pref_mail@163.com 11 months ago
parent
commit
5c3dabdaa7
  1. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java
  2. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  3. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionAppsignforDTO.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java
  5. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml
  6. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  7. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  8. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  9. 32
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  10. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  11. 341
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  12. 893
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  13. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  14. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java

@ -347,4 +347,10 @@ public class DistributionLoadscanEntity extends TenantEntity {
*/
@ApiModelProperty(value = "是否异常装车 1-否 2-是")
private Integer isAbnormalLoading;
/**
* 是否异常装车 1- 2-
*/
@ApiModelProperty(value = "是否异常装车 1-否 2-是")
private Integer isZero;
}

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

@ -500,6 +500,22 @@ public class DistributionDeliveryListController extends BladeController {
return r;
}
@PostMapping("/deliverySingleZeroPackage")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "PC签收包件")
public R deliverySingleZeroPackage(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R r = distributionSignforService.deliverySingleZeroPackage(distrilbutionloadingscanDTO);
return r;
}
@PostMapping("/deliveryZeroPackage")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "PC签收包件")
public R deliveryZeroPackage(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R r = distributionSignforService.signforZeroPC(distrilbutionloadingscanDTO);
return r;
}
@PostMapping("/cancelDelivery")

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

@ -42,6 +42,13 @@ public class DistrilbutionAppsignforDTO {
// @NotEmpty(message = "客户Id不能为空")
private Long reservationId;
/**
* 预约Id
*/
@ApiModelProperty(value = "预约Id")
// @NotEmpty(message = "客户Id不能为空")
private String zeroPackageIds;
/**
* 预约Id
*/

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

@ -57,4 +57,12 @@ public interface DistributionParcelNumberMapper extends BaseMapper<DistributionP
* @return
*/
List<DistributionParcelNumberVO> selectZeroPackage(@Param("stockArticleId") Long id);
/**
* 查询零担订单包件信息
* @param orderCode
* @param warehouseId
* @return
*/
List<DistributionParcelNumberEntity> selectParcelNumber(String orderCode, Long warehouseId);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml

@ -55,6 +55,16 @@
WHERE
ldpl.stock_article_id = #{stockArticleId}
</select>
<select id="selectParcelNumber" resultType="com.logpm.distribution.entity.DistributionParcelNumberEntity">
SELECT
ldpn.*
FROM
logpm_distribution_stock_article AS ldsa
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldsa.id = ldpl.stock_article_id AND ldpl.is_deleted = 0
LEFT JOIN logpm_distribution_parcel_number AS ldpn ON ldpl.id = ldpn.parcel_list_id AND ldpn.is_deleted = 0
WHERE
ldsa.order_code = #{orderCode} AND ldsa.warehouse_id = #{warehouseId} AND ldsa.is_deleted = 0
</select>
</mapper>

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

@ -79,7 +79,7 @@
<select id="selectClientListPage" resultMap="distributionStockArticleResultMap">
SELECT * from logpm_distribution_stock_article ldsa where
ldsa.is_deleted = 0 and ldsa.type_service ='2' and ldsa.genre = 1 and ldsa.reservation_status in ('10','20') and ldsa.order_status in ('10','20','30')
ldsa.is_deleted = 0 and ldsa.type_service ='2' and ldsa.genre = 1 and ldsa.reservation_status in ('10','20') and ldsa.order_status in ('10','20','30','70')
<if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''">
and ldsa.order_code like concat(#{distributionStockArticleVO.orderCode},'%')
</if>
@ -105,11 +105,6 @@
and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus}
</if>
<!-- 条件没有写完 -->
<if test="distributionStockArticleVO.orderCode != null and distributionStockArticleVO.orderCode != ''">
and ldsa.order_code like concat('%',#{distributionStockArticleVO.orderCode},'%')
</if>
<if test="distributionStockArticleVO.descriptionGoods != null and distributionStockArticleVO.descriptionGoods != ''">
and ldsa.description_goods like concat('%',#{distributionStockArticleVO.descriptionGoods},'%')
</if>

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

@ -197,4 +197,10 @@ public interface IDistributionParcelListService extends BaseService<Distribution
List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus);
/**
* 维护零担包件信息
* @param parcelListId
* @param warehouseId
*/
void maintenanceZeroPackageInfo(Long parcelListId, Long warehouseId);
}

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

@ -291,4 +291,18 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @return
*/
R searchNode(Integer searchType, String searchCode);
/**
* 零担PC签收
* @param distrilbutionloadingscanDTO
* @return
*/
R signforZeroPC(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO);
/**
* 零担配送单个签收
* @param distrilbutionloadingscanDTO
* @return
*/
R deliverySingleZeroPackage(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO);
}

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

@ -46,6 +46,9 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.node.PackageNode;
import org.springblade.common.utils.CommonUtil;
@ -1040,4 +1043,33 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.selectList(queryWrapper);
}
/**
* @param parcelListId
* @param warehouseId
*/
@Override
@Transactional
public void maintenanceZeroPackageInfo(Long parcelListId, Long warehouseId) {
DistributionParcelListEntity parcelListEntity = this.getById(parcelListId);
if (Func.isNotEmpty(parcelListEntity)){
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, parcelListEntity.getId())
);
if ((distributionParcelNumberEntity.getDeliveryQuantity() + distributionParcelNumberEntity.getOutboundQuantity())== parcelListEntity.getQuantity()){
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
}
if (distributionParcelNumberEntity.getOutboundQuantity() == parcelListEntity.getQuantity()){
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
}
if (distributionParcelNumberEntity.getSigninQuantity() == parcelListEntity.getQuantity()){
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
}else if (distributionParcelNumberEntity.getSigninQuantity() > 0){
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.bufenqianshou.getValue());
}
this.updateById(parcelListEntity);
}
}
}

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

@ -2239,9 +2239,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (zeroPackageNum > 0) {
list.forEach(l -> {
if (l.getHandQuantity() > 0) {
l.setReservationNum(l.getHandQuantity());
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setZeroPackageStatus(ReservationOrderStatusConstant.zhengchang.getValue());
distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity() - l.getDeliveryQuantity() - l.getOutboundQuantity());
distributionReservationZeroPackageEntity.setQuantity(l.getHandQuantity());
distributionReservationZeroPackageEntity.setStockArticleId(s.getId());
distributionReservationZeroPackageEntity.setReservationId(reservationEntity.getId());
distributionReservationZeroPackageEntity.setType(DistributionTypeConstant.shangpei.getValue());
@ -2249,12 +2250,18 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationZeroPackageEntity.setCategoryName(l.getFirsts());
distributionReservationZeroPackageEntity.setRealityQuantity(0);
distributionReservationZeroPackageService.save(distributionReservationZeroPackageEntity);
BigDecimal deliveryQuantity = new BigDecimal(l.getDeliveryQuantity());
BigDecimal reservationNum = new BigDecimal(l.getReservationNum());
l.setDeliveryQuantity(deliveryQuantity.add(reservationNum).intValue());
//计划冻结数
BigDecimal deliveryQuantity = new BigDecimal(distributionReservationZeroPackageEntity.getQuantity());
//本身冻结数
BigDecimal reservationNum = new BigDecimal(l.getDeliveryQuantity());
int value = deliveryQuantity.add(reservationNum).intValue();
l.setDeliveryQuantity(value);
distributionParcelNumberService.updateById(l);
reservationOrderNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity());
distributionAsyncService.checkZeroStockArticleReservationStatus(Func.copy(l, DistributionParcelNumberEntity.class));
// distributionAsyncService.checkZeroStockArticleReservationStatus(Func.copy(l, DistributionParcelNumberEntity.class));
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(),s.getWarehouseId());
//维护包件状态
distributionParcelListService.maintenanceZeroPackageInfo(l.getParcelListId(),l.getWarehouseId());
}
});
} else {

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

@ -852,6 +852,340 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.data(nodeVos);
}
/**
* @param distrilbutionloadingscanDTO
* @return
*/
@Override
public R signforZeroPC(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
String method = "#############DistributionSignforServiceImpl.signforZeroPC";
if (Func.isEmpty(distrilbutionloadingscanDTO.getZeroPackageIds())){
log.error(method+"参数异常,zeroPackageIds为空");
return R.fail("请联系管理员");
}
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
log.error(method+"参数异常,ReservationId为空");
return R.fail("请联系管理员");
}
String zeroPackageIds = distrilbutionloadingscanDTO.getZeroPackageIds();
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
List<Long> list = Func.toLongList(zeroPackageIds);
BladeUser user = AuthUtil.getUser();
//查询零担计划
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.in(DistributionReservationZeroPackageEntity::getParcelListId, list)
.ne(DistributionReservationZeroPackageEntity::getParcelListId, ReservationPackageStatusConstant.quxiao.getValue())
);
if (Func.isEmpty(reservationZeroPackageEntities)){
log.error(method+"预约单异常reservationId:{}",reservationId);
return R.fail("请联系管理员");
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isEmpty(deliveryListEntity)){
log.error(method+"配送单异常deliveryId:{}",distrilbutionloadingscanDTO.getDeliveryId());
return R.fail("请联系管理员");
}
String driverName = "";
String driverPhone = "";
String vehicleNub = "";
Long loadingId = null;
List<DistributionDeliverySelfVO> deliverySelfInfo = distributionDeliverySelfMapper.getDeliverySelfInfo(deliveryListEntity.getId());
//查询该车次负责司机
for (DistributionReservationZeroPackageEntity reservationZeroPackageEntity : reservationZeroPackageEntities) {
//查询订单
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(reservationZeroPackageEntity.getStockArticleId());
//查询零担包件详情
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, reservationZeroPackageEntity.getParcelListId())
);
//在库数
int a =0;
//签收数
int b =0;
//出库数
int c =0;
//冻结数
int d =0;
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, reservationId)
.in(DistributionLoadscanEntity::getPackageId, list)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isEmpty(loadscanEntity)){
if ("1".equals(deliveryListEntity.getKind())){
//自主配送
driverPhone = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverPhone).collect(Collectors.joining(","));
driverName = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverName).collect(Collectors.joining(","));
vehicleNub = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getVehicleNub).collect(Collectors.joining(","));
List<Long> collect = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getId).collect(Collectors.toList());
loadingId = collect.get(0);
}else if ("2".equals(deliveryListEntity.getKind())){
//外协
}else {
log.error(method+"配送司机异常:{}",distrilbutionloadingscanDTO.getDeliveryId());
return R.fail("请联系管理员");
}
a = distributionParcelNumberEntity.getHandQuantity() - reservationZeroPackageEntity.getQuantity();
b = distributionParcelNumberEntity.getSigninQuantity() + reservationZeroPackageEntity.getQuantity();
c = distributionParcelNumberEntity.getOutboundQuantity() + reservationZeroPackageEntity.getQuantity();
d = distributionParcelNumberEntity.getDeliveryQuantity() - reservationZeroPackageEntity.getQuantity();
//未进行装车操作
DistributionLoadscanEntity unLoadscanEntity = new DistributionLoadscanEntity();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss");
unLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
unLoadscanEntity.setIsInsert(2);
unLoadscanEntity.setLoadingId(loadingId.toString());
unLoadscanEntity.setOrderId(reservationZeroPackageEntity.getStockArticleId());
unLoadscanEntity.setPackageId(reservationZeroPackageEntity.getParcelListId());
unLoadscanEntity.setReservationId(reservationId);
unLoadscanEntity.setIsSignfor(1);
unLoadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
unLoadscanEntity.setScanUser(user.getNickName());
unLoadscanEntity.setIsAbnormalSigning(1);
unLoadscanEntity.setIsAbnormalLoading(1);
unLoadscanEntity.setIsZero(1);
unLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
unLoadscanEntity.setVehicleId(deliveryListEntity.getVehicleId());
unLoadscanEntity.setVehicleName(vehicleNub);
unLoadscanEntity.setDriverId(deliveryListEntity.getDriverId());
unLoadscanEntity.setDriverName(driverName);
unLoadscanEntity.setDriverPhone(driverPhone);
unLoadscanEntity.setLoadingId(driverPhone);
unLoadscanEntity.setScanType(LoadingStatusConstant.buluzhuangche.getValue());
unLoadscanEntity.setScanTime(simpleDateFormat.format(new Date()));
unLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date(System.currentTimeMillis() + (6 * 1000))));
unLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
unLoadscanEntity.setSigningUserId(user.getUserId());
unLoadscanEntity.setSigningUser(user.getNickName());
unLoadscanEntity.setIsSignfor(2);
unLoadscanEntity.setSignforState(2);
// loadscanEntity.setSigningTime(new Date().toString());
unLoadscanEntity.setReceivedQuantity(reservationZeroPackageEntity.getQuantity());
unLoadscanEntity.setLoadedNub(reservationZeroPackageEntity.getQuantity());
unLoadscanEntity.setPackageNub(reservationZeroPackageEntity.getQuantity());
unLoadscanEntity.setOneClick(1);
unLoadscanEntity.setOneQclick(1);
unLoadscanEntity.setMsg("文员进行零担订单装车和签收补录");
distributionLoadscanService.save(unLoadscanEntity);
//更新装车和签收数量
Integer i = distributionSignforMapper.updateSignforByReservationId(unLoadscanEntity.getDeliveryId(), unLoadscanEntity.getReservationId(), unLoadscanEntity.getReceivedQuantity());
//更新装车时间
Integer j = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新零担包件的数量
distributionParcelNumberEntity.setHandQuantity(a);
distributionParcelNumberEntity.setSigninQuantity(b);
distributionParcelNumberEntity.setOutboundQuantity(c);
distributionParcelNumberEntity.setDeliveryQuantity(d);
}else {
a = distributionParcelNumberEntity.getHandQuantity() + loadscanEntity.getLoadedNub() - reservationZeroPackageEntity.getQuantity();
b = distributionParcelNumberEntity.getSigninQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntity.getQuantity();
c = distributionParcelNumberEntity.getOutboundQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntity.getQuantity();
d = distributionParcelNumberEntity.getDeliveryQuantity() + loadscanEntity.getReceivedQuantity() - reservationZeroPackageEntity.getQuantity();
//存在装车操作
loadscanEntity.setSigningUser(user.getNickName());
loadscanEntity.setIsSignfor(2);
loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscanEntity.setSigningTime(new Date().toString());
loadscanEntity.setReceivedQuantity(reservationZeroPackageEntity.getQuantity());
loadscanEntity.setLoadedNub(reservationZeroPackageEntity.getQuantity());
loadscanEntity.setPackageNub(reservationZeroPackageEntity.getQuantity());
loadscanEntity.setMsg("文员进行签收补录");
distributionLoadscanService.updateById(loadscanEntity);
distributionParcelNumberEntity.setHandQuantity(a);
distributionParcelNumberEntity.setSigninQuantity(b);
distributionParcelNumberEntity.setOutboundQuantity(c);
distributionParcelNumberEntity.setDeliveryQuantity(d);
}
distributionParcelListService.maintenanceZeroPackageInfo(distributionParcelNumberEntity.getParcelListId(),stockArticleEntity.getWarehouseId());
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
//维护订单
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
}
//维护配送单信息
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
distributionDeliveryListService.updateById(deliveryListEntity);
//维护客户状态
distributionReservationService.maintenanceReservationInfo(reservationId);
//查询计划和是否进行装车
return R.success("操作成功");
}
/**
* @param distrilbutionloadingscanDTO
* @return
*/
@Override
public R deliverySingleZeroPackage(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
String method = "#############DistributionSignforServiceImpl.deliverySingleZeroPackage";
if (Func.isEmpty(distrilbutionloadingscanDTO.getZeroPackageIds())){
log.error(method+"参数异常,zeroPackageIds为空");
return R.fail("请联系管理员");
}
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
log.error(method+"参数异常,ReservationId为空");
return R.fail("请联系管理员");
}
//查询订单
String zeroPackageIds = distrilbutionloadingscanDTO.getZeroPackageIds();
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
BladeUser user = AuthUtil.getUser();
//查询零担计划
DistributionReservationZeroPackageEntity reservationZeroPackageEntities = distributionReservationZeroPackageService.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
.eq(DistributionReservationZeroPackageEntity::getParcelListId, zeroPackageIds)
.ne(DistributionReservationZeroPackageEntity::getParcelListId, ReservationPackageStatusConstant.quxiao.getValue())
);
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(reservationZeroPackageEntities.getStockArticleId());
if (Func.isEmpty(reservationZeroPackageEntities)){
log.error(method+"预约单异常reservationId:{}",reservationId);
return R.fail("请联系管理员");
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isEmpty(deliveryListEntity)){
log.error(method+"配送单异常deliveryId:{}",distrilbutionloadingscanDTO.getDeliveryId());
return R.fail("请联系管理员");
}
List<DistributionParcelNumberDTO> parcelListDTOS = distrilbutionloadingscanDTO.getParcelListDTOS();
if (parcelListDTOS.size()>1 || parcelListDTOS.size() == 0){
log.error(method+"提交零担订单错误:{}",distrilbutionloadingscanDTO.getDeliveryId());
return R.fail("请联系管理员");
}
DistributionParcelNumberDTO distributionParcelNumberDTO = parcelListDTOS.get(0);
if (distributionParcelNumberDTO.getNumber() > reservationZeroPackageEntities.getQuantity()){
//超过计划数
log.error(method+"签收零担订单数量超过计划数错误:{}",distributionParcelNumberDTO.getParcelListId());
return R.fail("请联系管理员");
}
//查询零担包件详情
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, reservationZeroPackageEntities.getParcelListId())
);
//进行签收数据补录或者修改
//查询是否存在签收装车信息
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, reservationId)
.eq(DistributionLoadscanEntity::getPackageId, zeroPackageIds)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
String driverName = "";
String driverPhone = "";
String vehicleNub = "";
Long loadingId = null;
//查询该车次负责司机
List<DistributionDeliverySelfVO> deliverySelfInfo = distributionDeliverySelfMapper.getDeliverySelfInfo(deliveryListEntity.getId());
//在库数
int a =0;
//签收数
int b =0;
//出库数
int c =0;
//冻结数
int d =0;
if (Func.isEmpty(loadscanEntity)){
if ("1".equals(deliveryListEntity.getKind())){
//自主配送
driverPhone = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverPhone).collect(Collectors.joining(","));
driverName = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverName).collect(Collectors.joining(","));
vehicleNub = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getVehicleNub).collect(Collectors.joining(","));
List<Long> collect = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getId).collect(Collectors.toList());
loadingId = collect.get(0);
}else if ("2".equals(deliveryListEntity.getKind())){
//外协
}else {
log.error(method+"配送司机异常:{}",distrilbutionloadingscanDTO.getDeliveryId());
return R.fail("请联系管理员");
}
a = distributionParcelNumberDTO.getHandQuantity() - reservationZeroPackageEntities.getQuantity();
b = distributionParcelNumberDTO.getSigninQuantity() + reservationZeroPackageEntities.getQuantity();
c = distributionParcelNumberDTO.getOutboundQuantity() + reservationZeroPackageEntities.getQuantity();
d = distributionParcelNumberDTO.getDeliveryQuantity() - reservationZeroPackageEntities.getQuantity();
//未进行装车操作
DistributionLoadscanEntity unLoadscanEntity = new DistributionLoadscanEntity();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss");
unLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
unLoadscanEntity.setIsInsert(2);
unLoadscanEntity.setLoadingId(loadingId.toString());
unLoadscanEntity.setOrderId(reservationZeroPackageEntities.getStockArticleId());
unLoadscanEntity.setPackageId(reservationZeroPackageEntities.getParcelListId());
unLoadscanEntity.setReservationId(reservationId);
unLoadscanEntity.setIsSignfor(1);
unLoadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
unLoadscanEntity.setScanUser(user.getNickName());
unLoadscanEntity.setIsAbnormalSigning(1);
unLoadscanEntity.setIsAbnormalLoading(1);
unLoadscanEntity.setIsZero(1);
unLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
unLoadscanEntity.setVehicleId(deliveryListEntity.getVehicleId());
unLoadscanEntity.setVehicleName(vehicleNub);
unLoadscanEntity.setDriverId(deliveryListEntity.getDriverId());
unLoadscanEntity.setDriverName(driverName);
unLoadscanEntity.setDriverPhone(driverPhone);
unLoadscanEntity.setLoadingId(driverPhone);
unLoadscanEntity.setScanType(LoadingStatusConstant.buluzhuangche.getValue());
unLoadscanEntity.setScanTime(simpleDateFormat.format(new Date()));
unLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date(System.currentTimeMillis() + (6 * 1000))));
unLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
unLoadscanEntity.setSigningUserId(user.getUserId());
unLoadscanEntity.setSigningUser(user.getNickName());
unLoadscanEntity.setIsSignfor(2);
unLoadscanEntity.setSignforState(2);
// loadscanEntity.setSigningTime(new Date().toString());
unLoadscanEntity.setReceivedQuantity(reservationZeroPackageEntities.getQuantity());
unLoadscanEntity.setLoadedNub(reservationZeroPackageEntities.getQuantity());
unLoadscanEntity.setPackageNub(reservationZeroPackageEntities.getQuantity());
unLoadscanEntity.setOneClick(1);
unLoadscanEntity.setOneQclick(1);
unLoadscanEntity.setMsg("文员进行零担订单装车和签收补录");
distributionLoadscanService.save(unLoadscanEntity);
//更新装车和签收数量
Integer i = distributionSignforMapper.updateSignforByReservationId(unLoadscanEntity.getDeliveryId(), unLoadscanEntity.getReservationId(), unLoadscanEntity.getReceivedQuantity());
//更新装车时间
Integer j = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新零担包件的数量
distributionParcelNumberEntity.setHandQuantity(a);
distributionParcelNumberEntity.setSigninQuantity(b);
distributionParcelNumberEntity.setOutboundQuantity(c);
distributionParcelNumberEntity.setDeliveryQuantity(d);
}else {
a = distributionParcelNumberEntity.getHandQuantity() + loadscanEntity.getLoadedNub() - reservationZeroPackageEntities.getQuantity();
b = distributionParcelNumberEntity.getSigninQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntities.getQuantity();
c = distributionParcelNumberEntity.getOutboundQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntities.getQuantity();
d = distributionParcelNumberEntity.getDeliveryQuantity() + loadscanEntity.getReceivedQuantity() - reservationZeroPackageEntities.getQuantity();
//存在装车操作
loadscanEntity.setSigningUser(user.getNickName());
loadscanEntity.setIsSignfor(2);
loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscanEntity.setSigningTime(new Date().toString());
loadscanEntity.setReceivedQuantity(reservationZeroPackageEntities.getQuantity());
loadscanEntity.setLoadedNub(reservationZeroPackageEntities.getQuantity());
loadscanEntity.setPackageNub(reservationZeroPackageEntities.getQuantity());
loadscanEntity.setMsg("文员进行签收补录");
distributionLoadscanService.updateById(loadscanEntity);
distributionParcelNumberEntity.setHandQuantity(a);
distributionParcelNumberEntity.setSigninQuantity(b);
distributionParcelNumberEntity.setOutboundQuantity(c);
distributionParcelNumberEntity.setDeliveryQuantity(d);
}
distributionParcelListService.maintenanceZeroPackageInfo(distributionParcelNumberEntity.getParcelListId(),stockArticleEntity.getWarehouseId());
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
//维护订单
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
//维护配送单信息
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
distributionDeliveryListService.updateById(deliveryListEntity);
//维护客户状态
distributionReservationService.maintenanceReservationInfo(reservationId);
return R.success("操作成功");
}
private List<DeliveryNodeVo> handleStockUp(DistributionStockupEntity distributionStockupEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
try {
@ -2617,8 +2951,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + distributionLoadscaninvnEntity.getPackageNub());
// distributionStockListService.updateById(stockListEntity);
// distributionAsyncService.checkSignStatus(null, distributionLoadscaninvnEntity.getReservationId(),distributionLoadscaninvnEntity.getDeliveryId());
}
//进行库存品包件状态维护
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity();
disStockListDetailEntity.setId(inventory.get(0).getId());
disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue());
disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue());
disStockListDetailService.updateById(disStockListDetailEntity);
} else if (inventory.isEmpty()) {
//这里就需要查询整个配送计划是否存在该码值的库存品包件
List<DisStockListDetailEntity> listDetailEntities = distributionDeliveryListMapper.selectInventoryListByDeliveryListId(distrilbutionloadingscanDTO.getReservationId());

893
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

File diff suppressed because it is too large Load Diff

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

@ -314,6 +314,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
distributionStockListEntity.setUnpackingQuantity(0);
distributionStockListEntity.setOutboundQuantity(0);
distributionStockListEntity.setMaterialId(aLong);
distributionStockListEntity.setSourceType("2");
distributionStockListEntity.setCargoUnit(DictBizCache.getValue(DictBizConstant.LOGPM_UNIT, distributionStockListDTO.getCargoUnit()));
distributionStockListEntity.setDescriptionGoods(distributionStockListDTO.getMaterialIdName());
distributionStockListEntity.setCargoNumber(distributionStockListDTO.getCargoNumber());

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

@ -2814,9 +2814,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
// AtomicReference<Integer> s = new AtomicReference<>(0); //已扫数量
v.stream().forEach(i -> {
DistributionParcelListEntity byId = distributionParcelListService.getById(i.getAssociationId());
if (!vo.getStockArticleId().contains(byId.getStockArticleId().toString())) {
f.set(false);
if(ObjectUtils.isNotNull(byId)){
if (!vo.getStockArticleId().contains(byId.getStockArticleId().toString())) {
f.set(false);
}
}
});
});

Loading…
Cancel
Save