|
|
|
@ -21,6 +21,8 @@ import com.logpm.trunkline.dto.InComingDTO;
|
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; |
|
|
|
|
import com.logpm.trunkline.feign.IInComingClient; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient; |
|
|
|
|
import com.logpm.warehouse.vo.TrayTypeDataVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
|
import org.springblade.common.annotations.ChangeAsync; |
|
|
|
@ -50,6 +52,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
|
|
|
|
|
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient; |
|
|
|
|
private final BladeRedis bladeRedis; |
|
|
|
|
private final IDistributionParcelListClient distributionParcelListClient; |
|
|
|
|
private final IWarehouseTrayTypeClient warehouseTrayTypeClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -299,31 +302,55 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
|
|
|
|
|
selectD.setInWarehouse(1); |
|
|
|
|
this.updateById(selectD); |
|
|
|
|
int a = 0; |
|
|
|
|
//记录当前车次的异常件数
|
|
|
|
|
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode(); |
|
|
|
|
Object o = bladeRedis.get(key); |
|
|
|
|
if (Objects.isNull(o)) { |
|
|
|
|
|
|
|
|
|
// 查询当前车次的异常入库数量
|
|
|
|
|
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getDistrCarNumber, distrCarNumber); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getInWarehouse, 1); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getIsDeleted, 0); |
|
|
|
|
List<BusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3); |
|
|
|
|
o = 1; |
|
|
|
|
if (!list3.isEmpty()) { |
|
|
|
|
o = list3.size(); |
|
|
|
|
|
|
|
|
|
if(StringUtil.isBlank(businessSanDTO.getTrayCode())){ |
|
|
|
|
//记录当前车次的异常件数
|
|
|
|
|
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber(); |
|
|
|
|
Object o = bladeRedis.get(key); |
|
|
|
|
if (Objects.isNull(o)) { |
|
|
|
|
|
|
|
|
|
// 查询当前车次的异常入库数量
|
|
|
|
|
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getDistrCarNumber, distrCarNumber); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getInWarehouse, 1); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getIsDeleted, 0); |
|
|
|
|
List<BusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3); |
|
|
|
|
o = 1; |
|
|
|
|
if (!list3.isEmpty()) { |
|
|
|
|
o = list3.size(); |
|
|
|
|
a = (int) o; |
|
|
|
|
} |
|
|
|
|
bladeRedis.setEx(key, o, 60 * 60 * 24L); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
a = (int) o; |
|
|
|
|
a = a + 1; |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
} |
|
|
|
|
bladeRedis.setEx(key, o, 60 * 60 * 24L); |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode(); |
|
|
|
|
Object o = bladeRedis.get(key); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(o)) { |
|
|
|
|
// 获取托盘上的数量
|
|
|
|
|
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(businessSanDTO.getTrayCode()); |
|
|
|
|
o = 1; |
|
|
|
|
if(!Objects.isNull(trayTypeDataVO)){ |
|
|
|
|
o=trayTypeDataVO.getOrderlNum(); |
|
|
|
|
} |
|
|
|
|
bladeRedis.setEx(key, o, 60 * 60 * 24L); |
|
|
|
|
}else{ |
|
|
|
|
a = (int) o; |
|
|
|
|
a = a + 1; |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
a = (int) o; |
|
|
|
|
a = a + 1; |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Resp.scanSuccess("扫描成功", a + "件"); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
@ -360,30 +387,55 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
|
|
|
|
|
t.setInWarehouse(1); |
|
|
|
|
this.updateById(t); |
|
|
|
|
int a = 0; |
|
|
|
|
//记录当前车次的异常件数
|
|
|
|
|
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber()); |
|
|
|
|
String key =RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode(); |
|
|
|
|
if (Objects.isNull(o)) { |
|
|
|
|
|
|
|
|
|
// 查询当前车次的异常入库数量
|
|
|
|
|
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getDistrCarNumber, distrCarNumber); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getOperationStatus, 1); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getInWarehouse, 1); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getIsDeleted, 0); |
|
|
|
|
List<BusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3); |
|
|
|
|
a = 1; |
|
|
|
|
if (!list3.isEmpty()) { |
|
|
|
|
a = list3.size(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(StringUtil.isNotBlank(businessSanDTO.getTrayCode())){ |
|
|
|
|
|
|
|
|
|
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode(); |
|
|
|
|
Object o = bladeRedis.get(key); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(o)) { |
|
|
|
|
// 获取托盘上的数量
|
|
|
|
|
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(businessSanDTO.getTrayCode()); |
|
|
|
|
o = 1; |
|
|
|
|
if(!Objects.isNull(trayTypeDataVO)){ |
|
|
|
|
o=trayTypeDataVO.getOrderlNum(); |
|
|
|
|
} |
|
|
|
|
bladeRedis.setEx(key, o, 60 * 60 * 24L); |
|
|
|
|
}else{ |
|
|
|
|
a = (int) o; |
|
|
|
|
a = a + 1; |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
} |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
a = (int) o; |
|
|
|
|
a = a + 1; |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
}else{ |
|
|
|
|
//记录当前车次的异常件数
|
|
|
|
|
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber()); |
|
|
|
|
String key =RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode(); |
|
|
|
|
if (Objects.isNull(o)) { |
|
|
|
|
|
|
|
|
|
// 查询当前车次的异常入库数量
|
|
|
|
|
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper3 = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getDistrCarNumber, distrCarNumber); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getOperationStatus, 1); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getInWarehouse, 1); |
|
|
|
|
queryWrapper3.eq(BusinessPreOrderEntity::getIsDeleted, 0); |
|
|
|
|
List<BusinessPreOrderEntity> list3 = baseMapper.selectList(queryWrapper3); |
|
|
|
|
a = 1; |
|
|
|
|
if (!list3.isEmpty()) { |
|
|
|
|
a = list3.size(); |
|
|
|
|
} |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
a = (int) o; |
|
|
|
|
a = a + 1; |
|
|
|
|
bladeRedis.setEx(key, a, 60 * 60 * 24L); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Resp.scanSuccess("扫描成功", "异常" + a + "件"); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|