Browse Source

异常驳回、推送安装平台日志

dist.1.3.0
汤建军 9 months ago
parent
commit
c650d0b7ff
  1. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  2. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  6. 84
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -128,6 +128,18 @@ public class DistributionSignforController extends BladeController {
return r;
}
/**
* 异常装车包件列表
*/
@PostMapping("/loadingAbnormalPackageListTurnDown")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distributionSignfor")
public R loadingAbnormalPackageListTurnDown(@RequestParam("ids") String ids) {
R r = distributionSignforService.loadingAbnormalPackageListTurnDown(ids);
return r;
}
/**
* 签收管理 签收订单统计

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

@ -376,4 +376,7 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @param parceListId
*/
Integer cancelOld(@Param("reservationId") Long reservationId,@Param("stockArticleId") Long stockArticleId,@Param("packageId") Long parceListId);
void deductionLoadingAndSignforPacjageNum(@Param("reservationId")Long reservationId,@Param("deliveryId") Long deliveryId,@Param("loadingNum") int loadingNum,@Param("signforNum") int signforNum);
}

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

@ -93,6 +93,11 @@
UPDATE logpm_distribution_signfor SET signee_name = #{user.nickName},signee_id = #{user.userId} WHERE
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
lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loaded_number !=0 and lds.delivery_id =
#{deliveryId}
</update>
<delete id="deleteByReservationAndDeliveryId">
DELETE FROM logpm_distribution_signfor
<where>

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

@ -357,4 +357,12 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @return
*/
List<DistributionSignforInventoryExcel> exportDistributionSignforInventoryList(Long id);
/**
* 异常驳回
* @param ids
* @return
*/
R loadingAbnormalPackageListTurnDown(String ids);
}

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

@ -3145,7 +3145,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
pushInstallDTO.setOrder(orderList);
pushInstallDTO.setOrder_detail(orderDetailList);
log.info(">>>>>>>>>>>>>>安装推送整理数据",JSONObject.toJSON(pushInstallDTO));
log.info(">>>>>>>>>>>>>>安装推送整理数据:{}",JSONObject.toJSON(pushInstallDTO));
String jsonString = JSONObject.toJSONString(pushInstallDTO);
rabbitTemplate.convertAndSend(RabbitConstant.PUSH_INSTALL_PLATFORM_EXCHANGE, RabbitConstant.PUSH_INSTALL_PLATFORM_ROUTING, jsonString);

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

@ -6479,6 +6479,90 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return baseMapper.getDistributionSignforInventoryList(id);
}
@Override
public R loadingAbnormalPackageListTurnDown(String ids) {
//异常驳回进行异常信息的删除,对于装车记录的清理,对于已装车和签收的数量扣减
String method = "####################异常驳回loadingAbnormalPackageListTurnDown";
if (Func.isEmpty(ids)){
log.error(method+"ids参数缺失:{}",ids);
}
List<Long> list = Func.toLongList(ids);
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.listByIds(list);
int loadingNum = 0;
int signforNum = 0;
List<Long> packageIdList = new ArrayList<>();
List<Long> orderIds = new ArrayList<>();
Long reservationId = null;
Long deliveryId = null;
if (!abnormalEntities.isEmpty()) {
List<Long> rIds = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getReservationId).distinct().collect(Collectors.toList());
List<Long> dIds = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getDeliveryListId).distinct().collect(Collectors.toList());
List<Long> packageIds = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getPackageId).distinct().collect(Collectors.toList());
if (rIds.size()>1){
log.error(method+"查询出多个reservatyionId:{}",rIds);
return R.fail("数据错误,请联系管理员");
}
if (dIds.size()>1){
log.error(method+"查询出多个deliveryId:{}",dIds);
return R.fail("数据错误,请联系管理员");
}
reservationId = rIds.get(0);
deliveryId = dIds.get(0);
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.in(DistributionLoadscanEntity::getPackageId, packageIds)
.eq(DistributionLoadscanEntity::getReservationId, reservationId)
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
List<DistributionLoadscanAbnormalEntity> updateList = new ArrayList<>();
if (!loadscanEntityList.isEmpty()) {
Map<Long, DistributionLoadscanEntity> loadscanMap = loadscanEntityList.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k, v) -> k));
//存在异常列表
//进行异常列表的清理
for (DistributionLoadscanAbnormalEntity abnormalEntity : abnormalEntities) {
abnormalEntity.setAuditingStatus(3);
abnormalEntity.setAuditingUser(AuthUtil.getNickName());
abnormalEntity.setAuditingTime(new Date());
abnormalEntity.setIsDeleted(1);
updateList.add(abnormalEntity);
//收集需要进行维护的包件
packageIdList.add(abnormalEntity.getPackageId());
//查询是否进行签收
// 统计需要进行扣减的签收数量
if (Func.isNotEmpty(loadscanMap.get(abnormalEntity.getPackageId()))){
//获取装车记录
DistributionLoadscanEntity distributionLoadscanEntity = loadscanMap.get(abnormalEntity.getPackageId());
orderIds.add(distributionLoadscanEntity.getOrderId());
if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
signforNum++;
}
}else {
//异常驳回无装车记录
log.error(method+"异常驳回无装车记录");
throw new RuntimeException("异常驳货列表存在无装车信息");
}
loadingNum++;
}
}
//进行装车记录的统计
}
//扣减装车和签收数
distributionSignforMapper.deductionLoadingAndSignforPacjageNum(reservationId,deliveryId,loadingNum,signforNum);
//恢复包件数据
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.in(DistributionParcelListEntity::getId,packageIdList)
.set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.daiyuyue.getValue())
.set(DistributionParcelListEntity::getOrderPackageLoadingStatus,OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.set(DistributionParcelListEntity::getOrderPackageStatus,OrderPackageStatusConstant.yiruku.getValue())
.set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.daibeihuo.getValue())
);
//维护相关的订单信息
distributionStockArticleService.maintenanceOrderInfoByIds(orderIds);
return R.success("异常驳回成功");
}
private void buildNameAndPhone(List<SignPushDataUnitDTO> pushOldPackageSigning) {
for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) {
User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId());

Loading…
Cancel
Save